From 6cb9ebbb256ec8dfd90008f73b6a1842851af9af Mon Sep 17 00:00:00 2001 From: Gabriel Baraldi Date: Wed, 13 Sep 2023 18:48:40 -0300 Subject: [PATCH] Update src/signals-unix.c Co-authored-by: Jameson Nash --- src/signals-unix.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/signals-unix.c b/src/signals-unix.c index 8dd833a196d41..b2056947e2b8a 100644 --- a/src/signals-unix.c +++ b/src/signals-unix.c @@ -1000,6 +1000,8 @@ static void sigtrap_handler(int sig, siginfo_t *info, void *context) uintptr_t pc = ((ucontext_t*)context)->uc_mcontext->__ss.__pc; // TODO: Do this in linux as well uint32_t* code = (uint32_t*)(pc); // https://gcc.gnu.org/legacy-ml/gcc-patches/2013-11/msg02228.html if (*code == 0xd4200020) { // brk #0x1 which is what LLVM defines as trap + signal(sig, SIG_DFL); + sig = SIGILL; // redefine this as as an "unreachable reached" error message sigdie_handler(sig, info, context); } }