Skip to content

Commit c35cb70

Browse files
committed
C++: Fix inconsistencies.
1 parent fd2f025 commit c35cb70

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,8 @@ private predicate sourceVariableIsGlobal(
766766
sourceVariableHasBaseAndIndex(sv, base, indirectionIndex) and
767767
irVar = base.getIRVariable() and
768768
irVar.getEnclosingIRFunction() = func and
769-
global = irVar.getAst()
769+
global = irVar.getAst() and
770+
not irVar instanceof IRDynamicInitializationFlag
770771
)
771772
}
772773

cpp/ql/test/library-tests/dataflow/dataflow-tests/dataflow-ir-consistency.expected

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@ uniqueType
44
uniqueNodeLocation
55
missingLocation
66
uniqueNodeToString
7-
| test.cpp:632:6:632:24 | Use of x indirection | Node should have one toString but has 2. |
8-
| test.cpp:632:6:632:24 | Use of x#init indirection | Node should have one toString but has 2. |
9-
| test.cpp:637:6:637:24 | Use of x indirection | Node should have one toString but has 2. |
10-
| test.cpp:637:6:637:24 | Use of x#init indirection | Node should have one toString but has 2. |
11-
| test.cpp:663:6:663:24 | Use of s indirection | Node should have one toString but has 2. |
12-
| test.cpp:663:6:663:24 | Use of s#init indirection | Node should have one toString but has 2. |
13-
| test.cpp:669:6:669:24 | Use of s indirection | Node should have one toString but has 2. |
14-
| test.cpp:669:6:669:24 | Use of s#init indirection | Node should have one toString but has 2. |
157
missingToString
168
parameterCallable
179
localFlowIsLocal

0 commit comments

Comments
 (0)