Author: Maciej Fijalkowski <[email protected]>
Branch:
Changeset: r79552:b46f34f3f2a9
Date: 2015-09-08 20:10 +0200
http://bitbucket.org/pypy/pypy/changeset/b46f34f3f2a9/
Log: fix
diff --git a/rpython/jit/metainterp/optimizeopt/info.py
b/rpython/jit/metainterp/optimizeopt/info.py
--- a/rpython/jit/metainterp/optimizeopt/info.py
+++ b/rpython/jit/metainterp/optimizeopt/info.py
@@ -708,6 +708,12 @@
def get_known_class(self, cpu):
if not self._const.nonnull():
return None
+ if cpu.supports_guard_gc_type:
+ # we should only be called on an unknown box here from
+ # virtualstate.py, which is only when the cpu supports
+ # guard_gc_type
+ if not cpu.check_is_object(self._const.getref_base()):
+ return None
return cpu.ts.cls_of_box(self._const)
def same_info(self, other):
diff --git a/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py
b/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py
--- a/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py
+++ b/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py
@@ -8767,6 +8767,11 @@
escape_n(ix)
jump(p0)
"""
+ ops = """
+ []
+ escape_n(0)
+ jump()
+ """
self.optimize_loop(ops, ops)
diff --git a/rpython/jit/metainterp/optimizeopt/test/test_util.py
b/rpython/jit/metainterp/optimizeopt/test/test_util.py
--- a/rpython/jit/metainterp/optimizeopt/test/test_util.py
+++ b/rpython/jit/metainterp/optimizeopt/test/test_util.py
@@ -135,7 +135,7 @@
node2addr = lltype.cast_opaque_ptr(llmemory.GCREF, node2)
myptr = lltype.cast_opaque_ptr(llmemory.GCREF, node)
mynode2 = lltype.malloc(NODE)
- myarray = lltype.cast_opaque_ptr(llmemory.GCREF,
lltype.malloc(lltype.GcArray(lltype.Signed), 13))
+ myarray = lltype.cast_opaque_ptr(llmemory.GCREF,
lltype.malloc(lltype.GcArray(lltype.Signed), 13, zero=True))
mynode2.parent.typeptr = node_vtable
myptr2 = lltype.cast_opaque_ptr(llmemory.GCREF, mynode2)
mynode3 = lltype.malloc(NODE2)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit