File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
cpp/ql/lib/semmle/code/cpp/controlflow Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -359,15 +359,21 @@ class IRGuardCondition extends Instruction {
359
359
* return x;
360
360
* ```
361
361
*/
362
- private IRBlock getBranchSuccessor ( boolean testIsTrue ) {
362
+ private IRBlock getBranchSuccessor ( AbstractValue v ) {
363
363
branch .( ConditionalBranchInstruction ) .getCondition ( ) = this and
364
- (
365
- testIsTrue = true and
364
+ exists ( BooleanValue bv | bv = v |
365
+ bv . getValue ( ) = true and
366
366
result .getFirstInstruction ( ) = branch .( ConditionalBranchInstruction ) .getTrueSuccessor ( )
367
367
or
368
- testIsTrue = false and
368
+ bv . getValue ( ) = false and
369
369
result .getFirstInstruction ( ) = branch .( ConditionalBranchInstruction ) .getFalseSuccessor ( )
370
370
)
371
+ or
372
+ exists ( SwitchInstruction switch , CaseEdge kind | switch = branch |
373
+ switch .getExpression ( ) = this and
374
+ result .getFirstInstruction ( ) = switch .getSuccessor ( kind ) and
375
+ kind = v .( MatchValue ) .getCase ( )
376
+ )
371
377
}
372
378
373
379
/** Holds if (determined by this guard) `left < right + k` evaluates to `isLessThan` if this expression evaluates to `testIsTrue`. */
You can’t perform that action at this time.
0 commit comments