File tree Expand file tree Collapse file tree 4 files changed +6
-5
lines changed
src/semmle/code/cpp/dataflow/internal
test/library-tests/dataflow/dataflow-tests Expand file tree Collapse file tree 4 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ private import cpp
66private import semmle.code.cpp.dataflow.internal.FlowVar
77private import semmle.code.cpp.models.interfaces.DataFlow
88private import semmle.code.cpp.controlflow.Guards
9- private import semmle.code.cpp.valuenumbering.GlobalValueNumbering
109
1110cached
1211private newtype TNode =
@@ -689,9 +688,9 @@ class BarrierGuard extends GuardCondition {
689688
690689 /** Gets a node guarded by this guard. */
691690 final ExprNode getAGuardedNode ( ) {
692- exists ( GVN value , boolean branch |
693- result .getExpr ( ) = value . getAnExpr ( ) and
694- this .checks ( value . getAnExpr ( ) , branch ) and
691+ exists ( SsaDefinition def , Variable v , boolean branch |
692+ result .getExpr ( ) = def . getAUse ( v ) and
693+ this .checks ( def . getAUse ( v ) , branch ) and
695694 this .controls ( result .getExpr ( ) .getBasicBlock ( ) , branch )
696695 )
697696 }
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ struct XY {
4848void bg_stackstruct (XY s1, XY s2) {
4949 s1.x = source ();
5050 if (guarded (s1.x )) {
51- sink (s1.x ); // no flow
51+ sink (s1.x ); // no flow [FALSE POSITIVE in AST]
5252 } else if (guarded (s1.y )) {
5353 sink (s1.x ); // flow
5454 } else if (guarded (s2.y )) {
Original file line number Diff line number Diff line change 33| BarrierGuard.cpp:25:10:25:15 | source | BarrierGuard.cpp:21:17:21:22 | source |
44| BarrierGuard.cpp:31:10:31:15 | source | BarrierGuard.cpp:29:16:29:21 | source |
55| BarrierGuard.cpp:33:10:33:15 | source | BarrierGuard.cpp:29:16:29:21 | source |
6+ | BarrierGuard.cpp:51:13:51:13 | x | BarrierGuard.cpp:49:10:49:15 | call to source |
67| BarrierGuard.cpp:53:13:53:13 | x | BarrierGuard.cpp:49:10:49:15 | call to source |
78| BarrierGuard.cpp:55:13:55:13 | x | BarrierGuard.cpp:49:10:49:15 | call to source |
89| BarrierGuard.cpp:62:14:62:14 | x | BarrierGuard.cpp:60:11:60:16 | call to source |
Original file line number Diff line number Diff line change 1+ | BarrierGuard.cpp:49:10:49:15 | BarrierGuard.cpp:51:13:51:13 | AST only |
12| BarrierGuard.cpp:60:11:60:16 | BarrierGuard.cpp:62:14:62:14 | AST only |
23| clang.cpp:12:9:12:20 | clang.cpp:22:8:22:20 | AST only |
34| clang.cpp:28:27:28:32 | clang.cpp:30:27:30:34 | AST only |
You can’t perform that action at this time.
0 commit comments