Skip to content

Commit 2614150

Browse files
committed
Do not fail if native object reference lookup fails
1 parent 13de574 commit 2614150

File tree

1 file changed

+6
-2
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/common

1 file changed

+6
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/common/ReferenceStack.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,12 @@ private void enlargeNativeReferenceList() {
6868

6969
@SuppressWarnings("unchecked")
7070
public T get(int idx) {
71-
assert 0 <= idx && idx < nativeObjectWrapperList.length;
72-
return (T) nativeObjectWrapperList[idx];
71+
if (0 <= idx && idx < nativeObjectWrapperList.length) {
72+
return (T) nativeObjectWrapperList[idx];
73+
} else {
74+
assert false : "incorrect reference ID";
75+
}
76+
return null;
7377
}
7478

7579
@SuppressWarnings("unchecked")

0 commit comments

Comments
 (0)