mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
C++: Remove omittable exists variables
This commit is contained in:
@@ -54,7 +54,7 @@ class SubBasicBlock extends ControlFlowNodeBase {
|
||||
* only condition under which a `SubBasicBlock` may have multiple
|
||||
* predecessors.
|
||||
*/
|
||||
predicate firstInBB() { exists(BasicBlock bb | this.getRankInBasicBlock(bb) = 1) }
|
||||
predicate firstInBB() { this.getRankInBasicBlock(_) = 1 }
|
||||
|
||||
/**
|
||||
* Holds if this `SubBasicBlock` comes last in its basic block. This is the
|
||||
|
||||
@@ -441,8 +441,8 @@ library class ExprEvaluator extends int {
|
||||
req = mid.(AssignExpr).getRValue()
|
||||
)
|
||||
or
|
||||
exists(VariableAccess va, Variable v, boolean sub1 |
|
||||
this.interestingVariableAccess(e, va, v, sub1) and
|
||||
exists(Variable v, boolean sub1 |
|
||||
this.interestingVariableAccess(e, _, v, sub1) and
|
||||
req = v.getAnAssignedValue() and
|
||||
(sub1 = true implies not this.ignoreVariableAssignment(e, v, req)) and
|
||||
sub = false
|
||||
@@ -876,7 +876,7 @@ private predicate nonAnalyzableVariableDefinition(Variable v, StmtParent def) {
|
||||
* empirically to have effect only on a few rare and pathological examples.
|
||||
*/
|
||||
private predicate tractableVariable(Variable v) {
|
||||
not exists(StmtParent def | nonAnalyzableVariableDefinition(v, def)) or
|
||||
not nonAnalyzableVariableDefinition(v, _) or
|
||||
strictcount(StmtParent def | nonAnalyzableVariableDefinition(v, def)) < 1000
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user