Author: Ronan Lamy <ronan.l...@gmail.com> Branch: multiphase Changeset: r91616:8bf0d6064d37 Date: 2017-06-16 18:45 +0100 http://bitbucket.org/pypy/pypy/changeset/8bf0d6064d37/
Log: really fix translation diff --git a/pypy/module/cpyext/typeobject.py b/pypy/module/cpyext/typeobject.py --- a/pypy/module/cpyext/typeobject.py +++ b/pypy/module/cpyext/typeobject.py @@ -927,11 +927,12 @@ i = 0 while True: slotdef = slotdefs[i] - if slotdef.c_slot == 0: + slotnum = rffi.cast(lltype.Signed, slotdef.c_slot) + if slotnum == 0: break - if slotdef.c_slot == cts.macros['Py_tp_base']: + elif slotnum == cts.macros['Py_tp_base']: w_base = from_ref(space, cts.cast('PyObject*', slotdef.c_pfunc)) - elif slotdef.c_slot == cts.macros['Py_tp_bases']: + elif slotnum == cts.macros['Py_tp_bases']: bases = cts.cast('PyObject*', slotdef.c_pfunc) bases_w = space.fixedview(from_ref(space, bases)) i += 1 @@ -959,9 +960,9 @@ i = 0 while True: slotdef = slotdefs[i] - if slotdef.c_slot == 0: + slot = rffi.cast(lltype.Signed, slotdef.c_slot) + if slot == 0: break - slot = slotdef.c_slot if slot < 0: # or slot > len(slotoffsets): raise oefmt(space.w_RuntimeError, "invalid slot offset") if slot in (cts.macros['Py_tp_base'], cts.macros['Py_tp_bases']): _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit