Author: Armin Rigo <[email protected]>
Branch: arm-backend-2
Changeset: r50597:2f5bb75ff7c8
Date: 2011-12-16 05:56 +0100
http://bitbucket.org/pypy/pypy/changeset/2f5bb75ff7c8/

Log:    Fix fail_boxes_count, which is one more than the highest index
        written. Add an assert checking that the pointer values written are
        really pointer-like.

diff --git a/pypy/jit/backend/arm/assembler.py 
b/pypy/jit/backend/arm/assembler.py
--- a/pypy/jit/backend/arm/assembler.py
+++ b/pypy/jit/backend/arm/assembler.py
@@ -262,6 +262,7 @@
             if group == self.INT_TYPE:
                 self.fail_boxes_int.setitem(fail_index, value)
             elif group == self.REF_TYPE:
+                assert (value & 3) == 0, "misaligned pointer"
                 tgt = self.fail_boxes_ptr.get_addr_for_num(fail_index)
                 rffi.cast(rffi.LONGP, tgt)[0] = value
             else:
@@ -270,7 +271,7 @@
 
         assert enc[i] == self.END_OF_LOCS
         descr = decode32(enc, i+1)
-        self.fail_boxes_count = fail_index
+        self.fail_boxes_count = fail_index + 1
         self.fail_force_index = frame_loc
         return descr
 
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to