Skip to content

Commit c89507d

Browse files
committed
Fix super exception
1 parent 4498ec5 commit c89507d

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ private PNone initFromLocalFrame(VirtualFrame frame, SuperObject self, PBytecode
270270
throw raise(RuntimeError, ErrorMessages.SUPER_EMPTY_CLASS);
271271
}
272272
Object obj = rootNode.readSelf(localFrame);
273-
if (obj == PNone.NONE || obj == PNone.NO_VALUE) {
273+
if (obj == null) {
274274
throw raise(RuntimeError, ErrorMessages.NO_ARGS, "super()");
275275
}
276276
return init(frame, self, cls, obj);

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/frame/MaterializeFrameNode.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public abstract static class SyncFrameValuesNode extends Node {
212212

213213
public abstract void execute(PFrame pyFrame, Frame frameToSync);
214214

215-
@Specialization(guards = {"hasLocals(pyFrame)", "frameToSync.getFrameDescriptor() == cachedFd",
215+
@Specialization(guards = {"!pyFrame.hasCustomLocals()", "frameToSync.getFrameDescriptor() == cachedFd",
216216
"variableSlotCount(cachedFd) < 32"}, limit = "1")
217217
@ExplodeLoop
218218
static void doSyncExploded(PFrame pyFrame, Frame frameToSync,
@@ -225,7 +225,7 @@ static void doSyncExploded(PFrame pyFrame, Frame frameToSync,
225225
}
226226
}
227227

228-
@Specialization(guards = "hasLocals(pyFrame)", replaces = "doSyncExploded")
228+
@Specialization(guards = "!pyFrame.hasCustomLocals()", replaces = "doSyncExploded")
229229
static void doSyncLoop(PFrame pyFrame, Frame frameToSync) {
230230
MaterializedFrame target = pyFrame.getLocals();
231231
int slotCount = variableSlotCount(frameToSync.getFrameDescriptor());
@@ -234,16 +234,12 @@ static void doSyncLoop(PFrame pyFrame, Frame frameToSync) {
234234
}
235235
}
236236

237-
@Specialization(guards = "!hasLocals(pyFrame)")
237+
@Specialization(guards = "pyFrame.hasCustomLocals()")
238238
@SuppressWarnings("unused")
239239
static void doCustomLocals(PFrame pyFrame, Frame frameToSync) {
240240
// nothing to do
241241
}
242242

243-
protected static boolean hasLocals(PFrame pyFrame) {
244-
return pyFrame.getLocals() != null;
245-
}
246-
247243
protected static int variableSlotCount(FrameDescriptor fd) {
248244
FrameInfo info = (FrameInfo) fd.getInfo();
249245
if (info == null) {

0 commit comments

Comments
 (0)