Skip to content

Commit 54fb1db

Browse files
committed
Fix assert condition in verifyNativeSmallInts
1 parent 7cb49c7 commit 54fb1db

File tree

1 file changed

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

1 file changed

+4
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi/CApiContext.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,8 +514,10 @@ private boolean verifyNativeSmallInts() {
514514
for (int i = 0; i < PY_NSMALLNEGINTS + PY_NSMALLPOSINTS; i++) {
515515
Object elementPtr = ReadPointerNode.getUncached().readArrayElement(nativeSmallIntsArray, i);
516516
PythonNativeWrapper wrapper = ToPythonWrapperNode.executeUncached(elementPtr, false);
517-
if (!(wrapper == primitiveNativeWrapperCache[i] && primitiveNativeWrapperCache[i].isNative() &&
518-
primitiveNativeWrapperCache[i].getRefCount() == IMMORTAL_REFCNT)) {
517+
if (wrapper != primitiveNativeWrapperCache[i]) {
518+
return false;
519+
}
520+
if (primitiveNativeWrapperCache[i].isNative() && primitiveNativeWrapperCache[i].getRefCount() != IMMORTAL_REFCNT) {
519521
return false;
520522
}
521523
}

0 commit comments

Comments
 (0)