File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
python/ql/lib/semmle/python/frameworks/internal Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -22,9 +22,10 @@ private import semmle.python.dataflow.new.DataFlow
2222/**
2323 * Gets the last decorator call for the function `func`, if `func` has decorators.
2424 */
25- private Expr lastDecoratorCall ( Function func ) {
26- result = func .getDefinition ( ) .( FunctionExpr ) .getADecoratorCall ( ) and
27- not exists ( Call other_decorator | other_decorator .getArg ( 0 ) = result )
25+ pragma [ nomagic]
26+ private DataFlow:: TypeTrackingNode lastDecoratorCall ( Function func ) {
27+ result .asExpr ( ) = func .getDefinition ( ) .( FunctionExpr ) .getADecoratorCall ( ) and
28+ not exists ( Call other_decorator | other_decorator .getArg ( 0 ) = result .asExpr ( ) )
2829}
2930
3031/**
@@ -56,7 +57,7 @@ private DataFlow::TypeTrackingNode poorMansFunctionTracker(DataFlow::TypeTracker
5657 //
5758 // Note that this means that we blindly ignore what the decorator actually does to
5859 // the function, which seems like an OK tradeoff.
59- result . asExpr ( ) = lastDecoratorCall ( func )
60+ result = pragma [ only_bind_out ] ( lastDecoratorCall ( func ) )
6061 )
6162 or
6263 exists ( DataFlow:: TypeTracker t2 | result = poorMansFunctionTracker ( t2 , func ) .track ( t2 , t ) )
You can’t perform that action at this time.
0 commit comments