@@ -185,7 +185,8 @@ private module Cached {
185
185
cached // nothing is actually cached
186
186
module BarrierGuard< guardChecksSig / 3 guardChecks> {
187
187
private predicate guardChecksAdjTypes (
188
- DataFlowIntegrationInput:: Guard g , DataFlowIntegrationInput:: Expr e , boolean branch
188
+ DataFlowIntegrationInput:: Guard g , DataFlowIntegrationInput:: Expr e ,
189
+ DataFlowIntegrationInput:: GuardValue branch
189
190
) {
190
191
guardChecks ( g , e .asExprCfgNode ( ) , branch )
191
192
}
@@ -283,6 +284,8 @@ class ParameterExt extends TParameterExt {
283
284
}
284
285
285
286
private module DataFlowIntegrationInput implements Impl:: DataFlowIntegrationInputSig {
287
+ private import codeql.util.Boolean
288
+
286
289
private newtype TExpr =
287
290
TExprCfgNode ( Cfg:: CfgNodes:: ExprCfgNode e ) or
288
291
TFinalEnvVarRead ( Scope scope , EnvVariable v ) {
@@ -330,21 +333,27 @@ private module DataFlowIntegrationInput implements Impl::DataFlowIntegrationInpu
330
333
any ( ParameterExt p ) .isInitializedBy ( def ) or def .( Ssa:: WriteDefinition ) .assigns ( _)
331
334
}
332
335
336
+ class GuardValue = Boolean ;
337
+
333
338
class Guard extends Cfg:: CfgNodes:: AstCfgNode {
334
339
/**
335
340
* Holds if the control flow branching from `bb1` is dependent on this guard,
336
341
* and that the edge from `bb1` to `bb2` corresponds to the evaluation of this
337
342
* guard to `branch`.
338
343
*/
339
- predicate controlsBranchEdge ( SsaInput:: BasicBlock bb1 , SsaInput:: BasicBlock bb2 , boolean branch ) {
340
- this .hasBranchEdge ( bb1 , bb2 , branch )
344
+ predicate valueControlsBranchEdge (
345
+ SsaInput:: BasicBlock bb1 , SsaInput:: BasicBlock bb2 , GuardValue branch
346
+ ) {
347
+ this .hasValueBranchEdge ( bb1 , bb2 , branch )
341
348
}
342
349
343
350
/**
344
351
* Holds if the evaluation of this guard to `branch` corresponds to the edge
345
352
* from `bb1` to `bb2`.
346
353
*/
347
- predicate hasBranchEdge ( SsaInput:: BasicBlock bb1 , SsaInput:: BasicBlock bb2 , boolean branch ) {
354
+ predicate hasValueBranchEdge (
355
+ SsaInput:: BasicBlock bb1 , SsaInput:: BasicBlock bb2 , GuardValue branch
356
+ ) {
348
357
exists ( Cfg:: SuccessorTypes:: ConditionalSuccessor s |
349
358
this .getBasicBlock ( ) = bb1 and
350
359
bb2 = bb1 .getASuccessor ( s ) and
@@ -354,7 +363,7 @@ private module DataFlowIntegrationInput implements Impl::DataFlowIntegrationInpu
354
363
}
355
364
356
365
/** Holds if the guard `guard` controls block `bb` upon evaluating to `branch`. */
357
- predicate guardDirectlyControlsBlock ( Guard guard , SsaInput:: BasicBlock bb , boolean branch ) {
366
+ predicate guardDirectlyControlsBlock ( Guard guard , SsaInput:: BasicBlock bb , GuardValue branch ) {
358
367
none ( )
359
368
}
360
369
}
0 commit comments