mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
change join order for summarizedHigherOrderCall
This commit is contained in:
@@ -1296,12 +1296,9 @@ private predicate summarizedHigherOrderCall(
|
||||
Function f, DataFlow::InvokeNode outer, DataFlow::InvokeNode inner, int j,
|
||||
DataFlow::Node innerArg, DataFlow::SourceNode cbParm, PathSummary oldSummary
|
||||
|
|
||||
reachableFromInput(f, outer, arg, innerArg, cfg, oldSummary) and
|
||||
// Only track actual parameter flow.
|
||||
// Captured flow does not need to be summarized - it is handled by the local case in `higherOrderCall`.
|
||||
not arg = DataFlow::capturedVariableNode(_) and
|
||||
argumentPassing(outer, cb, f, cbParm) and
|
||||
innerArg = inner.getArgument(j)
|
||||
summarizedHigherOrderCallAux(f, outer, arg, innerArg, cfg, oldSummary, cbParm, inner, j, cb)
|
||||
|
|
||||
// direct higher-order call
|
||||
cbParm.flowsTo(inner.getCalleeNode()) and
|
||||
@@ -1317,6 +1314,21 @@ private predicate summarizedHigherOrderCall(
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* @see `summarizedHigherOrderCall`.
|
||||
*/
|
||||
pragma[noinline]
|
||||
private predicate summarizedHigherOrderCallAux(
|
||||
Function f, DataFlow::InvokeNode outer, DataFlow::Node arg, DataFlow::Node innerArg,
|
||||
DataFlow::Configuration cfg, PathSummary oldSummary, DataFlow::SourceNode cbParm,
|
||||
DataFlow::InvokeNode inner, int j, DataFlow::Node cb
|
||||
) {
|
||||
reachableFromInput(f, outer, arg, innerArg, cfg, oldSummary) and
|
||||
// Only track actual parameter flow.
|
||||
argumentPassing(outer, cb, f, cbParm) and
|
||||
innerArg = inner.getArgument(j)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `arg` is passed as the `i`th argument to `callback` through a callback invocation.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user