diff --git a/python/ql/lib/semmle/python/frameworks/internal/PoorMansFunctionResolution.qll b/python/ql/lib/semmle/python/frameworks/internal/PoorMansFunctionResolution.qll index a7abc5302307..3d4d086b630e 100644 --- a/python/ql/lib/semmle/python/frameworks/internal/PoorMansFunctionResolution.qll +++ b/python/ql/lib/semmle/python/frameworks/internal/PoorMansFunctionResolution.qll @@ -22,9 +22,10 @@ private import semmle.python.dataflow.new.DataFlow /** * Gets the last decorator call for the function `func`, if `func` has decorators. */ -private Expr lastDecoratorCall(Function func) { - result = func.getDefinition().(FunctionExpr).getADecoratorCall() and - not exists(Call other_decorator | other_decorator.getArg(0) = result) +pragma[nomagic] +private DataFlow::TypeTrackingNode lastDecoratorCall(Function func) { + result.asExpr() = func.getDefinition().(FunctionExpr).getADecoratorCall() and + not exists(Call other_decorator | other_decorator.getArg(0) = result.asExpr()) } /** @@ -56,7 +57,7 @@ private DataFlow::TypeTrackingNode poorMansFunctionTracker(DataFlow::TypeTracker // // Note that this means that we blindly ignore what the decorator actually does to // the function, which seems like an OK tradeoff. - result.asExpr() = lastDecoratorCall(func) + result = pragma[only_bind_out](lastDecoratorCall(func)) ) or exists(DataFlow::TypeTracker t2 | result = poorMansFunctionTracker(t2, func).track(t2, t))