From ab1dfed69cecfac16a40d03de38dcf03fb55a013 Mon Sep 17 00:00:00 2001 From: Wim Lavrijsen Date: Wed, 17 Feb 2021 18:34:42 -0800 Subject: fix translation error on 32b Linux --- pypy/module/_cppyy/capi/loadable_capi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pypy/module/_cppyy/capi/loadable_capi.py b/pypy/module/_cppyy/capi/loadable_capi.py index b371c8ce47..2fa9b11dce 100644 --- a/pypy/module/_cppyy/capi/loadable_capi.py +++ b/pypy/module/_cppyy/capi/loadable_capi.py @@ -131,7 +131,8 @@ class W_RCTypeFunc(ctypefunc.W_CTypeFunc): elif obj.tc == 'm': misc.write_raw_signed_data(data, rffi.cast(rffi.INTPTR_T, obj._method), argtype.size) elif obj.tc == 'o': - misc.write_raw_signed_data(data, rffi.cast(rffi.VOIDP, obj._object), argtype.size) + # additional cast of void* to intptr_t required for 32b (or intmask fails) + misc.write_raw_signed_data(data, rffi.cast(rffi.INTPTR_T, rffi.cast(rffi.VOIDP, obj._object)), argtype.size) elif obj.tc == 'u': misc.write_raw_unsigned_data(data, rffi.cast(rffi.SIZE_T, obj._index), argtype.size) elif obj.tc == 'i': -- cgit v1.2.3-65-gdbad