Java: Redesign and reimplement variable capture flow.

This commit is contained in:
Anders Schack-Mulligen
2023-06-20 14:36:49 +02:00
parent 70bef64e2a
commit c5990311ca
22 changed files with 1023 additions and 459 deletions

View File

@@ -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 |

View File

@@ -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