Skip to content

Commit d39f2bc

Browse files
committed
mask sign extension when unsigned long comes from MSVC (4 bytes long) into Java (8 bytes long)
1 parent a70ea11 commit d39f2bc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/cext/PythonCextSlotBuiltins.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1801,8 +1801,9 @@ static Object doTpDictoffset(PythonManagedClass object, long value,
18011801
@CApiBuiltin(ret = Void, args = {PyTypeObject, UNSIGNED_LONG}, call = Ignored)
18021802
abstract static class Py_set_PyTypeObject_tp_flags extends CApiBinaryBuiltinNode {
18031803
@Specialization
1804-
static Object doTpFlags(PythonManagedClass object, long flags,
1804+
static Object doTpFlags(PythonManagedClass object, long signExtendedFlags,
18051805
@Cached TypeNodes.SetTypeFlagsNode setTypeFlagsNode) {
1806+
long flags = signExtendedFlags & 0xFFFFFFFFL;
18061807
if (object instanceof PythonBuiltinClass) {
18071808
/*
18081809
* Assert that we try to set the same flags, except the abc flags for sequence and

0 commit comments

Comments
 (0)