@@ -27,37 +27,33 @@ class ProtocolConfiguration extends DataFlow::Node {
2727 unsafe_context_creation ( this , _)
2828 }
2929
30- AstNode getNode ( ) { result = this .asCfgNode ( ) . ( CallNode ) . getFunction ( ) . getNode ( ) }
30+ DataFlow :: Node getNode ( ) { result = this .( DataFlow :: CallCfgNode ) . getFunction ( ) }
3131}
3232
3333// Helper for pretty printer `callName`.
3434// This is a consequence of missing pretty priting.
3535// We do not want to evaluate our bespoke pretty printer
36- // for all `AstNode`s so we define a sub class of interesting ones.
37- //
38- // Note that AstNode is abstract and AstNode_ is a library class, so
39- // we have to extend @py_ast_node.
40- class Nameable extends @py_ast_node {
36+ // for all `DataFlow::Node`s so we define a sub class of interesting ones.
37+ class Nameable extends DataFlow:: Node {
4138 Nameable ( ) {
4239 this = any ( ProtocolConfiguration pc ) .getNode ( )
4340 or
44- exists ( Nameable attr | this = attr . ( Attribute ) .getObject ( ) )
41+ this = any ( Nameable attr ) . ( DataFlow :: AttrRef ) .getObject ( )
4542 }
46-
47- string toString ( ) { result = "AstNode" }
4843}
4944
5045string callName ( Nameable call ) {
51- result = call .( Name ) .getId ( )
46+ result = call .asExpr ( ) . ( Name ) .getId ( )
5247 or
53- exists ( Attribute a | a = call | result = callName ( a .getObject ( ) ) + "." + a .getName ( ) )
48+ exists ( DataFlow:: AttrRef a | a = call |
49+ result = callName ( a .getObject ( ) ) + "." + a .getAttributeName ( )
50+ )
5451}
5552
5653string configName ( ProtocolConfiguration protocolConfiguration ) {
57- result =
58- "call to " + callName ( protocolConfiguration .asCfgNode ( ) .( CallNode ) .getFunction ( ) .getNode ( ) )
54+ result = "call to " + callName ( protocolConfiguration .( DataFlow:: CallCfgNode ) .getFunction ( ) )
5955 or
60- not protocolConfiguration . asCfgNode ( ) instanceof CallNode and
56+ not protocolConfiguration instanceof DataFlow :: CallCfgNode and
6157 not protocolConfiguration instanceof ContextCreation and
6258 result = "context modification"
6359}
0 commit comments