Skip to content

Commit fd937da

Browse files
committed
Fix: still allow unboxing.
1 parent 15b295c commit fd937da

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/interop/PTypeToForeignNode.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,18 @@ Object access(Object object) {
5656

5757
public static boolean isBoxed(Object object) {
5858
if (object instanceof PFloat) {
59-
return !((PFloat) object).isNative();
59+
return true;
6060
} else if (object instanceof PInt) {
6161
try {
6262
// try to use primitive
6363
PInt boxed = (PInt) object;
6464
boxed.longValueExact();
65-
return !boxed.isNative();
65+
return true;
6666
} catch (ArithmeticException e) {
6767
return false;
6868
}
6969
} else if (object instanceof PString) {
70-
return !((PString) object).isNative();
70+
return true;
7171
}
7272
return false;
7373
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/interop/PTypeUnboxNode.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,27 +54,27 @@ public static PTypeUnboxNode create() {
5454

5555
public abstract Object execute(Object value);
5656

57-
@Specialization(guards = "!obj.isNative()")
57+
@Specialization
5858
String access(PString obj) {
5959
return obj.getValue();
6060
}
6161

62-
@Specialization(guards = "!obj.isNative()")
62+
@Specialization
6363
double access(PFloat obj) {
6464
return obj.getValue();
6565
}
6666

67-
@Specialization(guards = "!obj.isNative()", rewriteOn = ArithmeticException.class)
67+
@Specialization(rewriteOn = ArithmeticException.class)
6868
int accessInt(PInt obj) {
6969
return obj.intValueExact();
7070
}
7171

72-
@Specialization(guards = "!obj.isNative()", rewriteOn = ArithmeticException.class)
72+
@Specialization(rewriteOn = ArithmeticException.class)
7373
long accessLong(PInt obj) {
7474
return obj.longValueExact();
7575
}
7676

77-
@Specialization(guards = "!obj.isNative()")
77+
@Specialization
7878
Object accessPInt(PInt obj) {
7979
try {
8080
// try to use primitive

0 commit comments

Comments
 (0)