mirror of
https://github.com/github/codeql.git
synced 2026-01-10 21:20:22 +01:00
Java: Redesign and reimplement variable capture flow.
This commit is contained in:
@@ -1222,18 +1222,14 @@ module Private {
|
||||
node.asNode().(PostUpdateNode).getPreUpdateNode().(ArgNode).argumentOf(mid.asCall(), apos) and
|
||||
parameterMatch(ppos, apos)
|
||||
|
|
||||
c = "Argument" and not heapParameter(ppos)
|
||||
or
|
||||
parseArg(c, ppos)
|
||||
c = "Argument" or parseArg(c, ppos)
|
||||
)
|
||||
or
|
||||
exists(ArgumentPosition apos, ParameterPosition ppos |
|
||||
node.asNode().(ParamNode).isParameterOf(mid.asCallable(), ppos) and
|
||||
parameterMatch(ppos, apos)
|
||||
|
|
||||
c = "Parameter" and not heapParameter(ppos)
|
||||
or
|
||||
parseParam(c, apos)
|
||||
c = "Parameter" or parseParam(c, apos)
|
||||
)
|
||||
or
|
||||
c = "ReturnValue" and
|
||||
@@ -1263,9 +1259,7 @@ module Private {
|
||||
node.asNode().(ArgNode).argumentOf(mid.asCall(), apos) and
|
||||
parameterMatch(ppos, apos)
|
||||
|
|
||||
c = "Argument" and not heapParameter(ppos)
|
||||
or
|
||||
parseArg(c, ppos)
|
||||
c = "Argument" or parseArg(c, ppos)
|
||||
)
|
||||
or
|
||||
exists(ReturnNodeExt ret |
|
||||
|
||||
@@ -241,12 +241,6 @@ private module UnusedSourceSinkInterpretation {
|
||||
|
||||
/** Provides additional source specification logic. */
|
||||
predicate interpretInputSpecific(string c, InterpretNode mid, InterpretNode node) { none() }
|
||||
|
||||
/**
|
||||
* Holds if `pos` is the position of the `heap` parameter, and thus should not
|
||||
* be included by models that specify "any argument" or "any parameter".
|
||||
*/
|
||||
predicate heapParameter(ParameterPosition pos) { none() }
|
||||
}
|
||||
|
||||
import UnusedSourceSinkInterpretation
|
||||
|
||||
Reference in New Issue
Block a user