File tree Expand file tree Collapse file tree 1 file changed +5
-14
lines changed
python/ql/lib/semmle/python/frameworks Expand file tree Collapse file tree 1 file changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -33,22 +33,13 @@ module Jinja2 {
3333 result = ModelOutput:: getATypeNode ( "jinja.Environment~Subclass" ) .getASubclass * ( )
3434 }
3535
36- /** Gets a reference to an instance of `jinja2.Environment`. */
37- private DataFlow:: TypeTrackingNode instance ( DataFlow:: TypeTracker t ) {
38- t .start ( ) and
39- result = EnvironmentClass:: classRef ( ) .getACall ( )
40- or
41- exists ( DataFlow:: TypeTracker t2 | result = instance ( t2 ) .track ( t2 , t ) )
42- }
43-
44- /** Gets a reference to an instance of `jinja2.Environment`. */
45- DataFlow:: Node instance ( ) { instance ( DataFlow:: TypeTracker:: end ( ) ) .flowsTo ( result ) }
36+ API:: Node instance ( ) { result = classRef ( ) .getAnInstance ( ) }
4637
4738 /** A call to `jinja2.Environment.from_string`. */
48- private class Jinja2FromStringConstruction extends TemplateConstruction:: Range ,
49- DataFlow :: MethodCallNode
50- {
51- Jinja2FromStringConstruction ( ) { this . calls ( EnvironmentClass :: instance ( ) , "from_string" ) }
39+ private class Jinja2FromStringConstruction extends TemplateConstruction:: Range , API :: CallNode {
40+ Jinja2FromStringConstruction ( ) {
41+ this = EnvironmentClass :: instance ( ) . getMember ( "from_string" ) . getACall ( )
42+ }
5243
5344 override DataFlow:: Node getSourceArg ( ) { result = this .getArg ( 0 ) }
5445 }
You can’t perform that action at this time.
0 commit comments