* src/vm/jit/arm/emit.c (emit_patcher_traps): Formerly known
[cacao.git] / src / vm / jit / arm / linux / md-os.c
index c88d893b74755cc30cc08061a42407adfc0d92aa..9e77a83e4da091fe9c8807523d0a090114985822 100644 (file)
@@ -166,11 +166,14 @@ void md_signal_handler_sigill(int sig, siginfo_t *siginfo, void *_p)
 
        o = exceptions_new_hardware_exception(pv, sp, ra, xpc, type, val);
 
-       /* set registers */
-
-       _sc->arm_r10 = (ptrint) o;
-       _sc->arm_fp  = (ptrint) xpc;
-       _sc->arm_pc  = (ptrint) asm_handle_exception;
+       /* set registers if we have an exception, return continue execution
+          otherwise (this is needed for patchers to work) */
+
+       if (o != NULL) {
+               _sc->arm_r10 = (ptrint) o;
+               _sc->arm_fp  = (ptrint) xpc;
+               _sc->arm_pc  = (ptrint) asm_handle_exception;
+       }
 }