Skip to content

Commit e51159d

Browse files
committed
Do not allow NONE/NO_VALUE for locals of custom frame
1 parent a2d7616 commit e51159d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/PythonCextBuiltins.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1491,7 +1491,13 @@ long getHash() {
14911491
abstract static class PyTruffleFrameNewNode extends PythonBuiltinNode {
14921492
@Specialization
14931493
Object newFrame(Object threadState, PCode code, PythonObject globals, Object locals) {
1494-
return factory().createPFrame(threadState, code, globals, locals);
1494+
Object frameLocals;
1495+
if (locals == null || PGuards.isPNone(locals)) {
1496+
frameLocals = factory().createDict();
1497+
} else {
1498+
frameLocals = locals;
1499+
}
1500+
return factory().createPFrame(threadState, code, globals, frameLocals);
14951501
}
14961502
}
14971503

0 commit comments

Comments
 (0)