mirror of
https://github.com/github/codeql.git
synced 2026-04-30 03:05:15 +02:00
JS: fix false positives for splice with conditional index decrement
This commit is contained in:
@@ -146,7 +146,12 @@ class ArrayIterationLoop extends ForStmt {
|
||||
or
|
||||
this.hasPathThrough(splice, cfg.getAPredecessor()) and
|
||||
this.getLoopEntry().dominates(cfg.getBasicBlock()) and
|
||||
not this.hasIndexingManipulation(cfg)
|
||||
not this.hasIndexingManipulation(cfg) and
|
||||
// Don't continue through a branch that tests the splice call's return value
|
||||
not exists(ConditionGuardNode guard | cfg = guard |
|
||||
guard.getTest() = splice.asExpr() and
|
||||
guard.getOutcome() = false
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user