@@ -4,6 +4,7 @@ private import semmle.python.objects.Instances
44private import semmle.python.pointsto.PointsTo
55private import semmle.python.pointsto.MRO
66private import semmle.python.types.Builtins
7+ private import semmle.python.objects.ObjectInternal
78
89
910/** A class whose instances represents Python classes.
@@ -99,7 +100,7 @@ class ClassObject extends Object {
99100
100101 /** Returns an attribute declared on this class (not on a super-class) */
101102 Object declaredAttribute ( string name ) {
102- exists ( Value val |
103+ exists ( ObjectInternal val |
103104 Types:: declaredAttribute ( theClass ( ) , name , val , _) and
104105 result = val .getSource ( )
105106 )
@@ -113,7 +114,7 @@ class ClassObject extends Object {
113114 /** Returns an attribute as it would be when looked up at runtime on this class.
114115 Will include attributes of super-classes */
115116 Object lookupAttribute ( string name ) {
116- exists ( Value val |
117+ exists ( ObjectInternal val |
117118 theClass ( ) .lookup ( name , val , _) and
118119 result = val .getSource ( )
119120 )
@@ -125,7 +126,7 @@ class ClassObject extends Object {
125126
126127 /** Looks up an attribute by searching this class' MRO starting at `start` */
127128 Object lookupMro ( ClassObject start , string name ) {
128- exists ( ClassObjectInternal other , ClassObjectInternal decl , Value val |
129+ exists ( ClassObjectInternal other , ClassObjectInternal decl , ObjectInternal val |
129130 other .getSource ( ) = start and
130131 decl = Types:: getMro ( theClass ( ) ) .startingAt ( other ) .findDeclaringClass ( name ) and
131132 Types:: declaredAttribute ( decl , name , val , _) and
@@ -140,7 +141,7 @@ class ClassObject extends Object {
140141
141142 /** Whether the named attribute refers to the object, class and origin */
142143 predicate attributeRefersTo ( string name , Object obj , ClassObject cls , ControlFlowNode origin ) {
143- exists ( Value val , CfgOrigin valorig |
144+ exists ( ObjectInternal val , CfgOrigin valorig |
144145 theClass ( ) .lookup ( name , val , valorig ) and
145146 obj = val .getSource ( ) and
146147 cls = val .getClass ( ) .getSource ( ) and
0 commit comments