Skip to content

Commit 67050b7

Browse files
committed
fix unbound effectively final cells
1 parent d30fd3d commit 67050b7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/cell/ReadLocalCellNode.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ public ReadFromCellNode(boolean isFreeVar, Object identifier) {
8181
Object readFinal(@SuppressWarnings("unused") PCell cell,
8282
@SuppressWarnings("unused") @Cached("cell") PCell cachedCell,
8383
@Cached("cell.getRef()") Object ref) {
84-
return ref;
84+
if (ref != null) {
85+
return ref;
86+
} else {
87+
throw raiseUnbound();
88+
}
8589
}
8690

8791
@Specialization(replaces = "readFinal")

0 commit comments

Comments
 (0)