File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
cpp/ql/test/library-tests/dataflow/dataflow-tests Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ module AstTest {
47
47
}
48
48
49
49
module IRTest {
50
+ private import cpp
50
51
private import semmle.code.cpp.ir.dataflow.DataFlow
51
52
private import semmle.code.cpp.ir.IR
52
53
private import semmle.code.cpp.controlflow.IRGuards
@@ -56,10 +57,13 @@ module IRTest {
56
57
* S in `if (guarded(x)) S`.
57
58
*/
58
59
// This is tested in `BarrierGuard.cpp`.
59
- predicate testBarrierGuard ( IRGuardCondition g , Instruction checked , boolean isTrue ) {
60
- g .( CallInstruction ) .getStaticCallTarget ( ) .getName ( ) = "guarded" and
61
- checked = g .( CallInstruction ) .getPositionalArgument ( 0 ) and
62
- isTrue = true
60
+ predicate testBarrierGuard ( IRGuardCondition g , Expr checked , boolean isTrue ) {
61
+ exists ( Call call |
62
+ call = g .getUnconvertedResultExpression ( ) and
63
+ call .getTarget ( ) .hasName ( "guarded" ) and
64
+ checked = call .getArgument ( 0 ) and
65
+ isTrue = true
66
+ )
63
67
}
64
68
65
69
/** Common data flow configuration to be used by tests. */
@@ -90,7 +94,7 @@ module IRTest {
90
94
barrierExpr .( VariableAccess ) .getTarget ( ) .hasName ( "barrier" )
91
95
)
92
96
or
93
- barrier = DataFlow:: InstructionBarrierGuard < testBarrierGuard / 3 > :: getABarrierNode ( )
97
+ barrier = DataFlow:: BarrierGuard < testBarrierGuard / 3 > :: getABarrierNode ( )
94
98
}
95
99
}
96
100
}
You can’t perform that action at this time.
0 commit comments