[pypy-commit] pypy jitframe-on-heap: some basic sanity check that seem to fail
fijal
noreply at buildbot.pypy.org
Wed Jan 30 13:29:13 CET 2013
Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: jitframe-on-heap
Changeset: r60726:76fcfafc2c24
Date: 2013-01-30 14:24 +0200
http://bitbucket.org/pypy/pypy/changeset/76fcfafc2c24/
Log: some basic sanity check that seem to fail
diff --git a/rpython/jit/backend/llsupport/jitframe.py b/rpython/jit/backend/llsupport/jitframe.py
--- a/rpython/jit/backend/llsupport/jitframe.py
+++ b/rpython/jit/backend/llsupport/jitframe.py
@@ -81,6 +81,7 @@
GCMAPLENGTHOFS = llmemory.arraylengthoffset(GCMAP)
GCMAPBASEOFS = llmemory.itemoffsetof(GCMAP, 0)
BASEITEMOFS = llmemory.itemoffsetof(JITFRAME.jf_frame, 0)
+LENGTHOFS = llmemory.arraylengthoffset(JITFRAME.jf_frame)
SIGN_SIZE = llmemory.sizeof(lltype.Signed)
UNSIGN_SIZE = llmemory.sizeof(lltype.Unsigned)
@@ -128,8 +129,12 @@
else:
new_state = 3 | ((state + 1) << 3) | (no << 9)
(obj_addr + getofs('jf_gc_trace_state')).signed[0] = new_state
+ index = no * SIZEOFSIGNED * 8 + state
+ # sanity check
+ frame_lgt = (obj_addr + getofs('jf_frame') + LENGTHOFS).signed[0]
+ ll_assert(index < frame_lgt, "bogus frame field get")
return (obj_addr + getofs('jf_frame') + BASEITEMOFS + SIGN_SIZE *
- (no * SIZEOFSIGNED * 8 + state))
+ (index))
no += 1
state = 0
return llmemory.NULL
diff --git a/rpython/jit/backend/llsupport/test/test_gc.py b/rpython/jit/backend/llsupport/test/test_gc.py
--- a/rpython/jit/backend/llsupport/test/test_gc.py
+++ b/rpython/jit/backend/llsupport/test/test_gc.py
@@ -272,7 +272,7 @@
jitframe.BASEITEMOFS + jitframe.SIGN_SIZE * no)
frame_info = lltype.malloc(jitframe.JITFRAMEINFO, zero=True, flavor='raw')
- frame = lltype.malloc(jitframe.JITFRAME, 15, zero=True)
+ frame = lltype.malloc(jitframe.JITFRAME, 100, zero=True)
frame.jf_frame_info = frame_info
frame.jf_gcmap = lltype.malloc(jitframe.GCMAP, 2, flavor='raw')
if sys.maxint == 2**31 - 1:
More information about the pypy-commit
mailing list