Author: Matti Picus <[email protected]>
Branch: 
Changeset: r96650:1939f3b020f8
Date: 2019-05-21 06:53 +0300
http://bitbucket.org/pypy/pypy/changeset/1939f3b020f8/

Log:    avoid void* arithmetic by changing vp += val to vp = (char*)vp + v,
        fix win32?

diff --git a/rpython/translator/c/gc.py b/rpython/translator/c/gc.py
--- a/rpython/translator/c/gc.py
+++ b/rpython/translator/c/gc.py
@@ -461,10 +461,12 @@
         raise Exception("gc_pop_roots should be removed by postprocess_graph")
 
     def OP_GC_ENTER_ROOTS_FRAME(self, funcgen, op):
-        return '(%s) += sizeof(pypy_ss_t);' % (funcgen.gcpol_ss,)
+        # avoid arithmatic on void*
+        return '({0}) = (char*)({0}) + 
sizeof(pypy_ss_t);'.format(funcgen.gcpol_ss,)
 
     def OP_GC_LEAVE_ROOTS_FRAME(self, funcgen, op):
-        return '(%s) -= sizeof(pypy_ss_t);' % (funcgen.gcpol_ss,)
+        # avoid arithmatic on void*
+        return '({0}) = (char*)({0}) - 
sizeof(pypy_ss_t);'.format(funcgen.gcpol_ss,)
 
     def OP_GC_SAVE_ROOT(self, funcgen, op):
         num = op.args[0].value
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to