We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5f80671 commit e9895afCopy full SHA for e9895af
graalpython/com.oracle.graal.python.jni/src/hpy_jni.c
@@ -280,10 +280,12 @@ static long augment_Long_AsLong(HPyContext *ctx, HPy h) {
280
static unsigned long augment_Long_AsUnsignedLong(HPyContext *ctx, HPy h) {
281
uint64_t bits = toBits(h);
282
if (isBoxedInt(bits)) {
283
- return unboxInt(bits);
284
- } else {
285
- return original_Long_AsUnsignedLong(ctx, h);
+ int32_t unboxed = unboxInt(bits);
+ if (unboxed >= 0) {
+ return unboxed;
286
+ }
287
}
288
+ return original_Long_AsUnsignedLong(ctx, h);
289
290
291
static double augment_Long_AsDouble(HPyContext *ctx, HPy h) {
0 commit comments