Merge pull request #12984 from aschackmull/dataflow/instanceof-node

Dataflow: Replace "extends Node" with "instanceof Node".
This commit is contained in:
Anders Schack-Mulligen
2023-05-02 13:52:33 +02:00
committed by GitHub
12 changed files with 364 additions and 44 deletions

View File

@@ -178,7 +178,7 @@ string captureThroughFlow(DataFlowTargetApi api) {
string output
|
ThroughFlow::flow(p, returnNodeExt) and
returnNodeExt.getEnclosingCallable() = api and
returnNodeExt.(DataFlow::Node).getEnclosingCallable() = api and
input = parameterNodeAsInput(p) and
output = returnNodeAsOutput(returnNodeExt) and
input != output and

View File

@@ -184,7 +184,7 @@ string returnNodeAsOutput(DataFlowImplCommon::ReturnNodeExt node) {
exists(int pos |
pos = node.getKind().(DataFlowImplCommon::ParamUpdateReturnKind).getPosition()
|
result = parameterAccess(node.getEnclosingCallable().getParameter(pos))
result = parameterAccess(node.(DataFlow::Node).getEnclosingCallable().getParameter(pos))
or
result = qualifierString() and pos = -1
)