Commits

Armin Rigo committed f84c2a8

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

Comments (0)

Files changed (2)

rpython/jit/backend/llgraph/support.py

             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:

rpython/jit/metainterp/pyjitpl.py

         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)