mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
C++: No need to exclude static and global initializers now that we inline the predicates.
This commit is contained in:
@@ -370,9 +370,6 @@ private predicate nonExcludedIRAndBasicBlock(IRBlock irb, BasicBlock controlled)
|
||||
*
|
||||
* Note that `&&` and `||` don't have an explicit representation in the IR,
|
||||
* and therefore will not appear as IRGuardConditions.
|
||||
*
|
||||
* For performance reasons conditions inside static local initializers or
|
||||
* global initializers are not considered `IRGuardCondition`s.
|
||||
*/
|
||||
class IRGuardCondition extends Instruction {
|
||||
Instruction branch;
|
||||
@@ -727,16 +724,9 @@ class IRGuardCondition extends Instruction {
|
||||
}
|
||||
|
||||
private Instruction getBranchForCondition(Instruction guard) {
|
||||
// There are a lot of guards inside global or static local initializers,
|
||||
// and on certain databases this can make the `ensures*` predicates
|
||||
// blow up.
|
||||
// These guards are likely not super important anyway.
|
||||
guard.getEnclosingFunction() instanceof Function and
|
||||
(
|
||||
result.(ConditionalBranchInstruction).getCondition() = guard
|
||||
or
|
||||
result.(SwitchInstruction).getExpression() = guard
|
||||
)
|
||||
result.(ConditionalBranchInstruction).getCondition() = guard
|
||||
or
|
||||
result.(SwitchInstruction).getExpression() = guard
|
||||
or
|
||||
exists(LogicalNotInstruction cond |
|
||||
result = getBranchForCondition(cond) and cond.getUnary() = guard
|
||||
|
||||
Reference in New Issue
Block a user