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 {
359359 * return x;
360360 * ```
361361 */
362- private IRBlock getBranchSuccessor ( boolean testIsTrue ) {
362+ private IRBlock getBranchSuccessor ( AbstractValue v ) {
363363 branch .( ConditionalBranchInstruction ) .getCondition ( ) = this and
364- (
365- testIsTrue = true and
364+ exists ( BooleanValue bv | bv = v |
365+ bv . getValue ( ) = true and
366366 result .getFirstInstruction ( ) = branch .( ConditionalBranchInstruction ) .getTrueSuccessor ( )
367367 or
368- testIsTrue = false and
368+ bv . getValue ( ) = false and
369369 result .getFirstInstruction ( ) = branch .( ConditionalBranchInstruction ) .getFalseSuccessor ( )
370370 )
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+ )
371377 }
372378
373379 /** 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