Skip to content

Commit eb3333c

Browse files
committed
Python: Prevent early join on argName in getArg
1 parent 0e2ec0d commit eb3333c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

python/ql/src/experimental/dataflow/internal/DataFlowPrivate.qll

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ module ArgumentPassing {
400400
exists(Function f, string argName |
401401
f = callable.getScope() and
402402
f.getArgName(paramN) = argName and
403-
result = TCfgNode(call.getArgByName(argName))
403+
result = TCfgNode(call.getArgByName(unbind_string(argName)))
404404
)
405405
or
406406
// a synthezised argument passed to the starred parameter (at position -1)
@@ -421,6 +421,10 @@ module ArgumentPassing {
421421
)
422422
}
423423

424+
/** Currently required in `getArg` in order to prevent a bad join. */
425+
bindingset[result, s]
426+
private string unbind_string(string s) { result <= s and s <= result }
427+
424428
/** Gets the control flow node that is passed as the `n`th overflow positional argument. */
425429
ControlFlowNode getPositionalOverflowArg(CallNode call, CallableValue callable, int n) {
426430
connects(call, callable) and

0 commit comments

Comments
 (0)