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 {
4747}
4848
4949module IRTest {
50+ private import cpp
5051 private import semmle.code.cpp.ir.dataflow.DataFlow
5152 private import semmle.code.cpp.ir.IR
5253 private import semmle.code.cpp.controlflow.IRGuards
@@ -56,10 +57,13 @@ module IRTest {
5657 * S in `if (guarded(x)) S`.
5758 */
5859 // 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+ )
6367 }
6468
6569 /** Common data flow configuration to be used by tests. */
@@ -90,7 +94,7 @@ module IRTest {
9094 barrierExpr .( VariableAccess ) .getTarget ( ) .hasName ( "barrier" )
9195 )
9296 or
93- barrier = DataFlow:: InstructionBarrierGuard < testBarrierGuard / 3 > :: getABarrierNode ( )
97+ barrier = DataFlow:: BarrierGuard < testBarrierGuard / 3 > :: getABarrierNode ( )
9498 }
9599 }
96100}
You can’t perform that action at this time.
0 commit comments