Skip to content

Commit 664c43e

Browse files
committed
Fix: did not initialize node.
1 parent 21fc53a commit 664c43e

File tree

1 file changed

+9
-1
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/superobject

1 file changed

+9
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/superobject/SuperBuiltins.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ private Object getClassFromTarget(VirtualFrame frame, PFrame target) {
269269
// TODO: do it properly via the python API in super.__init__ :
270270
// sys._getframe(1).f_code.co_closure?
271271
PDict locals = (PDict) target.getLocalsDict();
272-
Object cls = getItemNode.execute(frame, locals.getDictStorage(), SpecialAttributeNames.__CLASS__);
272+
Object cls = ensureGetItemNode().execute(frame, locals.getDictStorage(), SpecialAttributeNames.__CLASS__);
273273
if (cls instanceof PCell) {
274274
cls = getGetRefNode().execute((PCell) cls);
275275
if (cls == null) {
@@ -333,6 +333,14 @@ private LookupAndCallBinaryNode getGetAttr() {
333333
return getAttrNode;
334334
}
335335

336+
private HashingStorageNodes.GetItemNode ensureGetItemNode() {
337+
if (getItemNode == null) {
338+
CompilerDirectives.transferToInterpreterAndInvalidate();
339+
getItemNode = insert(HashingStorageNodes.GetItemNode.create());
340+
}
341+
return getItemNode;
342+
}
343+
336344
private PythonAbstractClass supercheck(VirtualFrame frame, Object cls, Object object) {
337345
/*
338346
* Check that a super() call makes sense. Return a type object.

0 commit comments

Comments
 (0)