@@ -36,12 +36,16 @@ predicate defaultAdditionalTaintStep(DataFlow::Node node1, DataFlow::Node node2,
36
36
defaultAdditionalTaintStep ( node1 , node2 ) and model = "" // TODO: set model
37
37
}
38
38
39
- bindingset [ node]
40
- pragma [ inline_late]
41
- private BasicBlock getBasicBlockFromSsa2 ( Ssa2:: Node node ) {
42
- result = node .( Ssa2:: ExprNode ) .getExpr ( ) .getBasicBlock ( )
43
- or
44
- result = node .( Ssa2:: SsaInputNode ) .getBasicBlock ( )
39
+ private predicate guardChecksFalsy (
40
+ Ssa2:: SsaDataflowInput:: Guard g , Ssa2:: SsaDataflowInput:: Expr e , boolean outcome
41
+ ) {
42
+ exists ( ConditionGuardNode guard |
43
+ guard .getTest ( ) = g and
44
+ guard .getOutcome ( ) = outcome and
45
+ e = g and
46
+ e instanceof VarAccess and
47
+ outcome = false
48
+ )
45
49
}
46
50
47
51
/**
@@ -64,13 +68,7 @@ private BasicBlock getBasicBlockFromSsa2(Ssa2::Node node) {
64
68
* ```
65
69
*/
66
70
private predicate varAccessBarrier ( DataFlow:: Node node ) {
67
- exists ( ConditionGuardNode guard , Ssa2:: ExprNode nodeFrom , Ssa2:: Node nodeTo |
68
- guard .getOutcome ( ) = false and
69
- guard .getTest ( ) .( VarAccess ) = nodeFrom .getExpr ( ) and
70
- Ssa2:: localFlowStep ( _, nodeFrom , nodeTo , true ) and
71
- guard .dominates ( getBasicBlockFromSsa2 ( nodeTo ) ) and
72
- node = getNodeFromSsa2 ( nodeTo )
73
- )
71
+ getNodeFromSsa2 ( Ssa2:: BarrierGuard< guardChecksFalsy / 3 > :: getABarrierNode ( ) ) = node
74
72
}
75
73
76
74
/**
0 commit comments