From 6c792e69b341de543d31598c63acbc8fa4cba429 Mon Sep 17 00:00:00 2001 From: Jeongsoo Lee Date: Wed, 11 Mar 2026 13:53:24 -0700 Subject: [PATCH] Expose the indirection index --- .../semmle/code/cpp/ir/dataflow/internal/DataFlowNodes.qll | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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..d1eccf8c1cce 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 @@ -767,10 +767,11 @@ module Public { */ class UninitializedNode extends Node { LocalVariable v; + int indirectionIndex; UninitializedNode() { exists(SsaImpl::Definition def, SsaImpl::SourceVariable sv | - def.getIndirectionIndex() = 0 and + def.getIndirectionIndex() = indirectionIndex and def.getValue().asInstruction() instanceof UninitializedInstruction and SsaImpl::defToNode(this, def, sv) and v = sv.getBaseVariable().(SsaImpl::BaseIRVariable).getIRVariable().getAst() @@ -779,6 +780,9 @@ module Public { /** Gets the uninitialized local variable corresponding to this node. */ LocalVariable getLocalVariable() { result = v } + + /** Gets the level of indirection to get to this node. */ + int getIndirectionIndex() { result = indirectionIndex } } /**