Merge pull request #4528 from tausbn/python-remove-cartesian-product-in-tkwoverflownode

Python: Prevent early join on `argName` in `getArg`
This commit is contained in:
yoff
2020-10-21 14:43:39 +02:00
committed by GitHub

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