Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r68820:f84c2a8494be
Date: 2014-01-21 16:31 +0100
http://bitbucket.org/pypy/pypy/changeset/f84c2a8494be/

Log:    Bah, we can also get AttributeError. Give up and catch Exception

diff --git a/rpython/jit/backend/llgraph/support.py 
b/rpython/jit/backend/llgraph/support.py
--- a/rpython/jit/backend/llgraph/support.py
+++ b/rpython/jit/backend/llgraph/support.py
@@ -69,7 +69,7 @@
             x = llmemory.cast_int_to_adr(x)
         try:   # pom pom pom
             return llmemory.cast_adr_to_ptr(x, TYPE)
-        except (TypeError, RuntimeError, NotImplementedError, ValueError):
+        except Exception:
             # assume that we want a "C-style" cast, without typechecking the 
value
             return rffi.cast(TYPE, x)
     elif TYPE == llmemory.Address:
diff --git a/rpython/jit/metainterp/pyjitpl.py 
b/rpython/jit/metainterp/pyjitpl.py
--- a/rpython/jit/metainterp/pyjitpl.py
+++ b/rpython/jit/metainterp/pyjitpl.py
@@ -594,9 +594,9 @@
         if tobox is not None:
             # sanity check: see whether the current struct value
             # corresponds to what the cache thinks the value is
-            #resbox = executor.execute(self.metainterp.cpu, self.metainterp,
-            #                          rop.GETFIELD_GC, fielddescr, box)
-            # XXX the sanity check does not seem to do anything, remove?
+            resbox = executor.execute(self.metainterp.cpu, self.metainterp,
+                                      rop.GETFIELD_GC, fielddescr, box)
+            assert resbox.constbox().same_constant(tobox.constbox())
             return tobox
         resbox = self.execute_with_descr(opnum, fielddescr, box)
         self.metainterp.heapcache.getfield_now_known(box, fielddescr, resbox)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to