File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/util Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ int narrowToInt(BigInteger x) {
64
64
return PInt .intValue (x );
65
65
}
66
66
67
- @ Specialization (guards = { "fitsIntoLong (x)", "!fitsIntoInt(x)" } )
67
+ @ Specialization (guards = "fitsIntoLongButNotInt (x)" )
68
68
long narrowToLong (BigInteger x ) {
69
69
return PInt .longValue (x );
70
70
}
@@ -80,6 +80,12 @@ static boolean fitsIntoInt(BigInteger x) {
80
80
return x .bitLength () <= 31 ;
81
81
}
82
82
83
+ @ TruffleBoundary
84
+ static boolean fitsIntoLongButNotInt (BigInteger x ) {
85
+ int bitLen = x .bitLength ();
86
+ return bitLen > 31 && bitLen <= 63 ;
87
+ }
88
+
83
89
@ TruffleBoundary
84
90
static boolean fitsIntoLong (BigInteger x ) {
85
91
return x .bitLength () <= 63 ;
You can’t perform that action at this time.
0 commit comments