Author: Carl Friedrich Bolz <[email protected]>
Branch: getarrayitem-into-bridges
Changeset: r92053:6a7534bc78d2
Date: 2017-08-03 21:41 +0200
http://bitbucket.org/pypy/pypy/changeset/6a7534bc78d2/
Log: a bug somewhere in heap.py that affects the new code that I wrote. I
did not manage to write a test for this or fix it at all. deal with
it gracefully, instead of crashing. (it's likely not really bad, but
might still be good to figure out what's going on).
diff --git a/rpython/jit/metainterp/optimizeopt/heap.py
b/rpython/jit/metainterp/optimizeopt/heap.py
--- a/rpython/jit/metainterp/optimizeopt/heap.py
+++ b/rpython/jit/metainterp/optimizeopt/heap.py
@@ -709,7 +709,12 @@
if not box1.is_constant() and box1 not in available_boxes:
continue
structinfo = cf.cached_infos[i]
- box2 = structinfo.getfield(descr).get_box_replacement()
+ box2 = structinfo.getfield(descr)
+ if box2 is None:
+ # XXX this should not happen, as it is an invariant
+ # violation! yet it does if box1 is a constant
+ continue
+ box2 = box2.get_box_replacement()
if box2.is_constant() or box2 in available_boxes:
result_getfield.append((box1, descr, box2))
result_array = []
@@ -721,7 +726,12 @@
if not box1.is_constant() and box1 not in available_boxes:
continue
arrayinfo = cf.cached_infos[i]
- box2 = arrayinfo.getitem(descr,
index).get_box_replacement()
+ box2 = arrayinfo.getitem(descr, index)
+ if box2 is None:
+ # XXX this should not happen, as it is an invariant
+ # violation! yet it does if box1 is a constant
+ continue
+ box2 = box2.get_box_replacement()
if box2.is_constant() or box2 in available_boxes:
result_array.append((box1, index, descr, box2))
return result_getfield, result_array
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit