David Schneider  committed 9c6fa4e

fix for build_frame_realloc_slowpath and _restore_exception

  • Participants
  • Parent commits 9db1c0d
  • Branches jitframe-on-heap

Comments (0)

Files changed (1)

File rpython/jit/backend/arm/

             assert excvalloc.is_reg()
             self.store_reg(mc, excvalloc, r.ip)
+            assert exctploc is not r.fp
             # load exc_value from JITFRAME and put it in pos_exc_value
             ofs = self.cpu.get_ofs_of_frame_field('jf_guard_exc')
             self.load_reg(mc, tmpreg, r.fp, ofs)
             self.store_reg(mc, tmpreg, r.ip)
+            # reset exc_value in the JITFRAME
+            mc.gen_load_int(tmpreg.value, 0)
+            self.store_reg(mc, tmpreg, r.fp, ofs)
+        # restore pos_exception from exctploc register
         mc.gen_load_int(r.ip.value, self.cpu.pos_exception())
         self.store_reg(mc, exctploc, r.ip)
         # store a possibly present exception
         # we use a callee saved reg here as a tmp for the exc.
-        self._store_and_reset_exception(mc, None, r.fp, on_frame=True)
+        self._store_and_reset_exception(mc, None, r.r4, on_frame=True)
         # call realloc_frame, it takes two arguments
         # arg0: the old jitframe
+        # set fp to the new jitframe returned from the previous call
+        mc.MOV_rr(r.fp.value, r.r0.value)
         # restore a possibly present exception
-        self._restore_exception(mc, None, r.fp)
-        # set fp to the new jitframe
-        mc.MOV_rr(r.fp.value, r.r0.value)
+        self._restore_exception(mc, None, r.r4)
         gcrootmap = self.cpu.gc_ll_descr.gcrootmap
         if gcrootmap and gcrootmap.is_shadow_stack: