diff --git a/cpp/ql/src/semmle/code/cpp/controlflow/IRGuards.qll b/cpp/ql/src/semmle/code/cpp/controlflow/IRGuards.qll index 2052eac4cf42..79c65fc75f1f 100644 --- a/cpp/ql/src/semmle/code/cpp/controlflow/IRGuards.qll +++ b/cpp/ql/src/semmle/code/cpp/controlflow/IRGuards.qll @@ -381,9 +381,7 @@ cached class IRGuardCondition extends Instruction { } private ConditionalBranchInstruction get_branch_for_condition(Instruction guard) { - exists(ConditionalBranchInstruction branch| - branch.getCondition() = guard - ) + result.getCondition() = guard or exists(LogicalNotInstruction cond | result = get_branch_for_condition(cond) and cond.getUnary() = guard) }