mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
JS: Fix a bad join order
This commit is contained in:
@@ -955,12 +955,17 @@ module API {
|
||||
result = min(int i | expr.getArgument(i) instanceof SpreadElement)
|
||||
}
|
||||
|
||||
pragma[nomagic]
|
||||
private InvokeExpr getAnInvocationWithSpread(DataFlow::SourceNode node, int i) {
|
||||
result = node.getAnInvocation().asExpr() and
|
||||
i = firstSpreadIndex(result)
|
||||
}
|
||||
|
||||
private predicate spreadArgumentPassing(TApiNode base, int i, DataFlow::Node spreadArray) {
|
||||
exists(DataFlow::Node use, DataFlow::SourceNode pred, int bound, InvokeExpr invoke |
|
||||
use(base, use) and
|
||||
pred = trackUseNode(use, _, bound, "") and
|
||||
invoke = pred.getAnInvocation().asExpr() and
|
||||
i = firstSpreadIndex(invoke) and
|
||||
invoke = getAnInvocationWithSpread(pred, i) and
|
||||
spreadArray = invoke.getArgument(i - bound).(SpreadElement).getOperand().flow()
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user