@@ -2275,7 +2275,7 @@ private predicate guardControlsPhiInput(
2275
2275
*/
2276
2276
signature predicate guardChecksSig ( IRGuardCondition g , Expr e , boolean branch ) ;
2277
2277
2278
- bindingset [ g, n ]
2278
+ bindingset [ g]
2279
2279
pragma [ inline_late]
2280
2280
private predicate controls ( IRGuardCondition g , Node n , boolean edge ) {
2281
2281
g .controls ( n .getBasicBlock ( ) , edge )
@@ -2288,6 +2288,13 @@ private predicate controls(IRGuardCondition g, Node n, boolean edge) {
2288
2288
* in data flow and taint tracking.
2289
2289
*/
2290
2290
module BarrierGuard< guardChecksSig / 3 guardChecks> {
2291
+ bindingset [ value, n]
2292
+ pragma [ inline_late]
2293
+ private predicate convertedExprHasValueNumber ( Expr e , ValueNumber value , Node n ) {
2294
+ e = value .getAnInstruction ( ) .getConvertedResultExpression ( ) and
2295
+ n .asConvertedExpr ( ) = e
2296
+ }
2297
+
2291
2298
/**
2292
2299
* Gets an expression node that is safely guarded by the given guard check.
2293
2300
*
@@ -2322,8 +2329,7 @@ module BarrierGuard<guardChecksSig/3 guardChecks> {
2322
2329
*/
2323
2330
Node getABarrierNode ( ) {
2324
2331
exists ( IRGuardCondition g , Expr e , ValueNumber value , boolean edge |
2325
- e = value .getAnInstruction ( ) .getConvertedResultExpression ( ) and
2326
- result .asConvertedExpr ( ) = e and
2332
+ convertedExprHasValueNumber ( e , value , result ) and
2327
2333
guardChecks ( g ,
2328
2334
pragma [ only_bind_into ] ( value .getAnInstruction ( ) .getConvertedResultExpression ( ) ) , edge ) and
2329
2335
controls ( g , result , edge )
0 commit comments