[pypy-commit] pypy hpy: try a translation fix

antocuni pypy.commits at gmail.com
Fri Jan 10 19:12:37 EST 2020


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: hpy
Changeset: r98521:a8d815f56da1
Date: 2020-01-10 21:50 +0100
http://bitbucket.org/pypy/pypy/changeset/a8d815f56da1/

Log:	try a translation fix

diff --git a/pypy/module/hpy_universal/interp_module.py b/pypy/module/hpy_universal/interp_module.py
--- a/pypy/module/hpy_universal/interp_module.py
+++ b/pypy/module/hpy_universal/interp_module.py
@@ -52,7 +52,10 @@
             dst.c_ml_meth = rffi.cast(PyCFunction, src.c_ml_meth)
             rffi.setintfield(dst, 'c_ml_flags', widen(src.c_ml_flags) & ~llapi._HPy_METH)
         pymethods[n].c_ml_name = lltype.nullptr(rffi.CONST_CCHARP.TO)
-        convert_method_defs(space, dict_w, pymethods, None, w_mod, modname)
+        #
+        # convert_method_defs expects a PyMethodDef*, not a PyMethodDef[]
+        p_pymethods = rffi.cast(lltype.Ptr(PyMethodDef), pymethods)
+        convert_method_defs(space, dict_w, p_pymethods, None, w_mod, modname)
 
     for key, w_func in dict_w.items():
         space.setattr(w_mod, space.newtext(key), w_func)


More information about the pypy-commit mailing list