Skip to content

Commit

Permalink
Update src/signals-unix.c
Browse files Browse the repository at this point in the history
Co-authored-by: Jameson Nash <[email protected]>
  • Loading branch information
gbaraldi and vtjnash authored Sep 13, 2023
1 parent be4f517 commit 6cb9ebb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/signals-unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 6cb9ebb

Please sign in to comment.