aboutsummaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-01-13 01:00:02 +0000
committerChris Lattner <sabre@nondot.org>2003-01-13 01:00:02 +0000
commit61253a9c93f30e6d6e9007ff9e6fa496eaca89ad (patch)
tree246e14326d7e3adb7566629f4af3131bf694a6b7 /lib/ExecutionEngine
parentb111874b386f5e3d807a8f78edb010b40d507115 (diff)
Bad segvs actually cause a segv now
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5255 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r--lib/ExecutionEngine/JIT/Callback.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/ExecutionEngine/JIT/Callback.cpp b/lib/ExecutionEngine/JIT/Callback.cpp
index b843e10689..3b40e2ebe1 100644
--- a/lib/ExecutionEngine/JIT/Callback.cpp
+++ b/lib/ExecutionEngine/JIT/Callback.cpp
@@ -19,8 +19,15 @@ static void TrapHandler(int TN, siginfo_t *SI, ucontext_t *ucp) {
#ifdef REG_EIP /* this code does not compile on Sparc! */
if (SI->si_code != SEGV_MAPERR || SI->si_addr != 0 ||
ucp->uc_mcontext.gregs[REG_EIP] != 0) {
- std::cerr << "Bad SEGV encountered!\n";
- abort();
+ std::cerr << "Bad SEGV encountered EIP = 0x" << std::hex
+ << ucp->uc_mcontext.gregs[REG_EIP] << " addr = "
+ << SI->si_addr << "!\n";
+
+ struct sigaction SA; // Restore old SEGV handler...
+ SA.sa_handler = SIG_DFL;
+ SA.sa_flags = SA_NOMASK;
+ sigaction(SIGSEGV, &SA, 0);
+ return; // Should core dump now...
}
// The call instruction should have pushed the return value onto the stack...