Skip to content

Commit 68f24cd

Browse files
authored
Merge pull request #8462 from michaelnebel/csharp/capture-models-fix-bad-join-order
C#: Fix bad join order in returnNodeAsOutput.
2 parents e669ffa + 5f7b5ec commit 68f24cd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

csharp/ql/src/utils/model-generator/ModelGeneratorUtilsSpecific.qll

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ string parameterNodeAsInput(DataFlow::ParameterNode p) {
8686
result = "Argument[Qualifier]" and p instanceof InstanceParameterNode
8787
}
8888

89+
pragma[nomagic]
90+
private Parameter getParameter(ReturnNodeExt node, ParameterPosition pos) {
91+
result = node.getEnclosingCallable().getParameter(pos.getPosition())
92+
}
93+
8994
/**
9095
* Gets the model string represention of the the return node `node`.
9196
*/
@@ -94,7 +99,7 @@ string returnNodeAsOutput(ReturnNodeExt node) {
9499
then result = "ReturnValue"
95100
else
96101
exists(ParameterPosition pos | pos = node.getKind().(ParamUpdateReturnKind).getPosition() |
97-
result = parameterAccess(node.getEnclosingCallable().getParameter(pos.getPosition()))
102+
result = parameterAccess(getParameter(node, pos))
98103
or
99104
pos.isThisParameter() and
100105
result = "Argument[Qualifier]"

0 commit comments

Comments
 (0)