Python: Prevent early join on argName in getArg

This commit is contained in:
Taus Brock-Nannestad
2020-10-21 13:23:09 +02:00
parent 0e2ec0dfb4
commit eb3333c0ce

View File

@@ -400,7 +400,7 @@ module ArgumentPassing {
exists(Function f, string argName |
f = callable.getScope() and
f.getArgName(paramN) = argName and
result = TCfgNode(call.getArgByName(argName))
result = TCfgNode(call.getArgByName(unbind_string(argName)))
)
or
// a synthezised argument passed to the starred parameter (at position -1)
@@ -421,6 +421,10 @@ module ArgumentPassing {
)
}
/** Currently required in `getArg` in order to prevent a bad join. */
bindingset[result, s]
private string unbind_string(string s) { result <= s and s <= result }
/** Gets the control flow node that is passed as the `n`th overflow positional argument. */
ControlFlowNode getPositionalOverflowArg(CallNode call, CallableValue callable, int n) {
connects(call, callable) and