Skip to content

Commit 6c86b31

Browse files
committed
Generalize to long if int and long has been seen.
1 parent 83f31ef commit 6c86b31

File tree

1 file changed

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

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -913,12 +913,14 @@ static byte doByteNativeWrapper(@SuppressWarnings("unused") CExtContext cextCont
913913
}
914914

915915
@Specialization(guards = {"object.isInt()", "mayUsePrimitive(isPointerNode, object)"}, limit = "1")
916-
static int doIntNativeWrappe(@SuppressWarnings("unused") CExtContext cextContext, PrimitiveNativeWrapper object,
916+
static int doIntNativeWrapper(@SuppressWarnings("unused") CExtContext cextContext, PrimitiveNativeWrapper object,
917917
@Shared("isPointerNode") @Cached @SuppressWarnings("unused") IsPointerNode isPointerNode) {
918918
return object.getInt();
919919
}
920920

921-
@Specialization(guards = {"object.isLong()", "mayUsePrimitive(isPointerNode, object)"}, limit = "1")
921+
@Specialization(guards = {"object.isInt() || object.isLong()", "mayUsePrimitive(isPointerNode, object)"}, //
922+
limit = "1", //
923+
replaces = "doIntNativeWrapper")
922924
static long doLongNativeWrapper(@SuppressWarnings("unused") CExtContext cextContext, PrimitiveNativeWrapper object,
923925
@Shared("isPointerNode") @Cached @SuppressWarnings("unused") IsPointerNode isPointerNode) {
924926
return object.getLong();

0 commit comments

Comments
 (0)