Skip to content

Commit 4f40531

Browse files
committed
Fix unbound cell handler
1 parent 1fcdc05 commit 4f40531

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/bytecode/PBytecodeRootNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3236,7 +3236,7 @@ private PException bytecodeRaiseVarargs(VirtualFrame virtualFrame, int stackTop,
32363236

32373237
private void raiseUnboundCell(Node[] localNodes, int bci, int oparg, boolean useCachedNodes) {
32383238
PRaiseNode raiseNode = insertChildNode(localNodes, bci, UNCACHED_RAISE, PRaiseNodeGen.class, NODE_RAISE, useCachedNodes);
3239-
if (oparg < freeoffset) {
3239+
if (oparg < cellvars.length) {
32403240
throw raiseNode.raise(PythonBuiltinClassType.UnboundLocalError, ErrorMessages.LOCAL_VAR_REFERENCED_BEFORE_ASSIGMENT, cellvars[oparg]);
32413241
} else {
32423242
int varIdx = oparg - cellvars.length;

0 commit comments

Comments
 (0)