Skip to content

Commit 690e2ae

Browse files
authored
Merge pull request #1116 from rdmarsh2/rdmarsh/cpp/ir-guards-perf
C++: fix cartesian product in IRGuards.qll
2 parents 0b2f44b + dfb7076 commit 690e2ae

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

cpp/ql/src/semmle/code/cpp/controlflow/IRGuards.qll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,9 +381,7 @@ cached class IRGuardCondition extends Instruction {
381381
}
382382

383383
private ConditionalBranchInstruction get_branch_for_condition(Instruction guard) {
384-
exists(ConditionalBranchInstruction branch|
385-
branch.getCondition() = guard
386-
)
384+
result.getCondition() = guard
387385
or
388386
exists(LogicalNotInstruction cond | result = get_branch_for_condition(cond) and cond.getUnary() = guard)
389387
}

0 commit comments

Comments
 (0)