+ // Decode machine-dependent trap instruction.
+ bool decode_result = md_trap_decode(&trp, sig, xpc, &es);
+
+ // Check if the trap instruction is valid and was decoded
+ // successfully.
+ if (!decode_result) {
+ // Check if the PC has been patched during our way to this
+ // trap handler (see PR85).
+ // NOTE: Some archs use SIGILL for other traps too, but it's OK to
+ // do this check anyway because it will fail.
+ if (patcher_is_patched_at(xpc) == true) {
+ if (opt_PrintWarnings)
+ log_println("trap_handle: Detected patcher race condition (PR85) at %p", xpc);
+ return;
+ }
+
+ // We have a problem...
+ vm_abort_disassemble(xpc, 1, "trap_handle: Unknown trap instruction at %p", xpc);
+ }
+
+ // For convenience only.
+ int type = trp.type;
+ intptr_t val = trp.value;
+