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
22
22
/**
23
23
* Gets the last decorator call for the function `func`, if `func` has decorators.
24
24
*/
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 ( ) )
28
29
}
29
30
30
31
/**
@@ -56,7 +57,7 @@ private DataFlow::TypeTrackingNode poorMansFunctionTracker(DataFlow::TypeTracker
56
57
//
57
58
// Note that this means that we blindly ignore what the decorator actually does to
58
59
// the function, which seems like an OK tradeoff.
59
- result . asExpr ( ) = lastDecoratorCall ( func )
60
+ result = pragma [ only_bind_out ] ( lastDecoratorCall ( func ) )
60
61
)
61
62
or
62
63
exists ( DataFlow:: TypeTracker t2 | result = poorMansFunctionTracker ( t2 , func ) .track ( t2 , t ) )
You can’t perform that action at this time.
0 commit comments