From 09caeca7e9b3347cebd9f4a5e2a563d9c38a9ea9 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Mon, 23 Mar 2026 13:27:20 +0000 Subject: [PATCH 1/4] C++: Move parameter indirection nodes into the public API. --- .../code/cpp/ir/dataflow/internal/DataFlowNodes.qll | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowNodes.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowNodes.qll index fe954c640d1b..36dc85f4f409 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowNodes.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowNodes.qll @@ -795,6 +795,12 @@ module Public { /** An explicit positional parameter, including `this`, but not `...`. */ final class DirectParameterNode = AbstractDirectParameterNode; + /** + * A node representing an indirection of a positional parameter, + * including `*this`, but not `*...`. + */ + final class IndirectParameterNode = AbstractIndirectParameterNode; + final class ExplicitParameterNode = AbstractExplicitParameterNode; /** An implicit `this` parameter. */ @@ -954,11 +960,6 @@ module Public { private import Public -/** - * A node representing an indirection of a parameter. - */ -final class IndirectParameterNode = AbstractIndirectParameterNode; - /** * A class that lifts pre-SSA dataflow nodes to regular dataflow nodes. */ From 1363c54a9f16d26e52c845478f67eb2b55f10d09 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Mon, 23 Mar 2026 13:28:33 +0000 Subject: [PATCH 2/4] C++: Add 'asIndirectInstruction' as a public predicate. --- .../semmle/code/cpp/ir/dataflow/internal/DataFlowNodes.qll | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowNodes.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowNodes.qll index 36dc85f4f409..51eabe8b2231 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowNodes.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowNodes.qll @@ -321,6 +321,12 @@ module Public { */ Operand asIndirectOperand(int index) { hasOperandAndIndex(this, result, index) } + /** + * Gets the instruction that is indirectly tracked by this node behind + * `index` number of indirections. + */ + Instruction asIndirectInstruction(int index) { hasInstructionAndIndex(this, result, index) } + /** * Holds if this node is at index `i` in basic block `block`. * From fef314e27fff8f92d06aa807545097443fdf0aa2 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Mon, 23 Mar 2026 13:39:15 +0000 Subject: [PATCH 3/4] C++: Add change note. --- ...-23-indirect-parameter-nodes-and-indirect-instructions.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 cpp/ql/lib/change-notes/2026-03-23-indirect-parameter-nodes-and-indirect-instructions.md diff --git a/cpp/ql/lib/change-notes/2026-03-23-indirect-parameter-nodes-and-indirect-instructions.md b/cpp/ql/lib/change-notes/2026-03-23-indirect-parameter-nodes-and-indirect-instructions.md new file mode 100644 index 000000000000..c3bd4028ee97 --- /dev/null +++ b/cpp/ql/lib/change-notes/2026-03-23-indirect-parameter-nodes-and-indirect-instructions.md @@ -0,0 +1,5 @@ +--- +category: feature +--- +* Added a class `DataFlow::IndirectParameterNode` to represent the indirection of a parameter as a dataflow node. +* Added a predicate `Node::asIndirectInstruction` which returns the `Instruction` that defines the indirect dataflow node, if any. \ No newline at end of file From 8cebf510dc9964c40121dd89cf43dedbb3be2b73 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Mon, 23 Mar 2026 13:45:46 +0000 Subject: [PATCH 4/4] C++: Reword the change note from #21458. --- .../change-notes/2026-03-20-add-indirect-uninitialized-node.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/ql/lib/change-notes/2026-03-20-add-indirect-uninitialized-node.md b/cpp/ql/lib/change-notes/2026-03-20-add-indirect-uninitialized-node.md index 60f6b0a276ed..07235e047d43 100644 --- a/cpp/ql/lib/change-notes/2026-03-20-add-indirect-uninitialized-node.md +++ b/cpp/ql/lib/change-notes/2026-03-20-add-indirect-uninitialized-node.md @@ -1,4 +1,4 @@ --- category: feature --- -* Added a new data flow node, `IndirectUninitializedNode`, that represents uninitialized local variables behind a number of indirections. +* Added a class `IndirectUninitializedNode` to represent the indirection of an uninitialized local variable as a dataflow node.