Skip to content

Commit 6c792e6

Browse files
committed
Expose the indirection index
1 parent bbd02b8 commit 6c792e6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowNodes.qll

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,10 +767,11 @@ module Public {
767767
*/
768768
class UninitializedNode extends Node {
769769
LocalVariable v;
770+
int indirectionIndex;
770771

771772
UninitializedNode() {
772773
exists(SsaImpl::Definition def, SsaImpl::SourceVariable sv |
773-
def.getIndirectionIndex() = 0 and
774+
def.getIndirectionIndex() = indirectionIndex and
774775
def.getValue().asInstruction() instanceof UninitializedInstruction and
775776
SsaImpl::defToNode(this, def, sv) and
776777
v = sv.getBaseVariable().(SsaImpl::BaseIRVariable).getIRVariable().getAst()
@@ -779,6 +780,9 @@ module Public {
779780

780781
/** Gets the uninitialized local variable corresponding to this node. */
781782
LocalVariable getLocalVariable() { result = v }
783+
784+
/** Gets the level of indirection to get to this node. */
785+
int getIndirectionIndex() { result = indirectionIndex }
782786
}
783787

784788
/**

0 commit comments

Comments
 (0)