File tree Expand file tree Collapse file tree 3 files changed +4
-3
lines changed
lib/semmle/code/cpp/ir/dataflow/internal
test/library-tests/dataflow Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ private import DataFlowImplCommon as DataFlowImplCommon
6
6
private import DataFlowUtil
7
7
private import semmle.code.cpp.models.interfaces.PointerWrapper
8
8
private import DataFlowPrivate
9
+ private import semmle.code.cpp.ir.ValueNumbering
9
10
10
11
/**
11
12
* Holds if `operand` is an operand that is not used by the dataflow library.
@@ -864,7 +865,7 @@ private module Cached {
864
865
* to a specific address.
865
866
*/
866
867
private predicate isCertainAddress ( Operand operand ) {
867
- operand . getDef ( ) instanceof VariableAddressInstruction
868
+ valueNumberOfOperand ( operand ) . getAnInstruction ( ) instanceof VariableAddressInstruction
868
869
or
869
870
operand .getType ( ) instanceof Cpp:: ReferenceType
870
871
}
Original file line number Diff line number Diff line change @@ -732,7 +732,7 @@ void test_does_not_write_source_to_dereference()
732
732
{
733
733
int x;
734
734
does_not_write_source_to_dereference (&x);
735
- sink (x); // $ ast,ir =733:7 SPURIOUS: ast,ir =726:11
735
+ sink (x); // $ ast=733:7 ir SPURIOUS: ast=726:11
736
736
}
737
737
738
738
void sometimes_calls_sink_eq (int x, int n) {
Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ void pointer_test() {
134
134
sink (*p3); // $ ast,ir
135
135
136
136
*p3 = 0 ;
137
- sink (*p3); // $ SPURIOUS: ast,ir
137
+ sink (*p3); // $ SPURIOUS: ast
138
138
}
139
139
140
140
// --- return values ---
You can’t perform that action at this time.
0 commit comments