Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2cb4a55

Browse files
committed
C++: Fix a bug in Expr <-> Node mapping.
1 parent 09df318 commit 2cb4a55

4 files changed

Lines changed: 107 additions & 250 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ private predicate indirectExprNodeShouldBeIndirectOperand(RawIndirectOperand nod
988988
e = e0.getFullyConverted()
989989
)
990990
or
991-
not indirectExprNodeShouldBeIndirectOperand0(_, _, e.getUnconverted()) and
991+
not indirectExprNodeShouldBeIndirectOperand0(_, node, _) and
992992
e = instr.getConvertedResultExpression()
993993
)
994994
}

cpp/ql/test/library-tests/dataflow/dataflow-tests/clang.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@ void following_pointers( // $ ast-def=sourceStruct1_ptr
4848

4949
int stackArray[2] = { source(), source() };
5050
stackArray[0] = source();
51-
sink(stackArray); // $ ast ir
51+
sink(stackArray); // $ ast ir ir=49:35 ir=50:19
5252
}

0 commit comments

Comments
 (0)