From d89fe6378d46640442a3a6d5d4807644ebdd14af Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Mon, 8 Sep 2025 17:43:59 +0100 Subject: [PATCH] C++: Add 'asParameter' on Definition. --- cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaImpl.qll | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaImpl.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaImpl.qll index b9f320e57b23..f638abe27e6b 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaImpl.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaImpl.qll @@ -1156,6 +1156,12 @@ class Definition extends SsaImpl::Definition { ) } + Parameter asParameter() { + this.getIndirectionIndex() = 0 and + getDefImpl(this).getValue().asInstruction().(InitializeParameterInstruction).getParameter() = + result + } + /** * Gets an `Operand` that represents an indirect use of this definition. *