summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2003-10-10 17:03:22 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2003-10-10 17:03:22 +0000
commit235b200e6bae0bbad52f0f31d3c615e498b3565e (patch)
tree607fc4e076ff5cf8e9e8c7466b684dd35e84908f /lib/ExecutionEngine
parent58a6faac65d2e5f60a650c6f99bb6c615ad9fbc6 (diff)
downloadllvm-235b200e6bae0bbad52f0f31d3c615e498b3565e.tar.gz
llvm-235b200e6bae0bbad52f0f31d3c615e498b3565e.tar.bz2
llvm-235b200e6bae0bbad52f0f31d3c615e498b3565e.tar.xz
Never set any signal handlers.
Never call setjmp(), longjmp() or strsignal(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9014 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r--lib/ExecutionEngine/Interpreter/Execution.cpp39
1 files changed, 2 insertions, 37 deletions
diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp
index d3818063d0..e6ca036c3f 100644
--- a/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/lib/ExecutionEngine/Interpreter/Execution.cpp
@@ -13,9 +13,7 @@
#include "llvm/Assembly/Writer.h"
#include "Support/CommandLine.h"
#include "Support/Statistic.h"
-#include <math.h> // For fmod
-#include <signal.h>
-#include <setjmp.h>
+#include <cmath> // For fmod
Interpreter *TheEE = 0;
@@ -38,27 +36,6 @@ namespace {
//
CachedWriter CW; // Object to accelerate printing of LLVM
-sigjmp_buf SignalRecoverBuffer;
-static bool InInstruction = false;
-
-extern "C" {
-static void SigHandler(int Signal) {
- if (InInstruction)
- siglongjmp(SignalRecoverBuffer, Signal);
-}
-}
-
-static void initializeSignalHandlers() {
- struct sigaction Action;
- Action.sa_handler = SigHandler;
- Action.sa_flags = SA_SIGINFO;
- sigemptyset(&Action.sa_mask);
- sigaction(SIGSEGV, &Action, 0);
- sigaction(SIGBUS, &Action, 0);
- sigaction(SIGINT, &Action, 0);
- sigaction(SIGFPE, &Action, 0);
-}
-
//===----------------------------------------------------------------------===//
// Value Manipulation code
@@ -120,7 +97,6 @@ static void SetValue(Value *V, GenericValue Val, ExecutionContext &SF) {
void Interpreter::initializeExecutionEngine() {
TheEE = this;
- initializeSignalHandlers();
}
//===----------------------------------------------------------------------===//
@@ -681,8 +657,7 @@ GenericValue Interpreter::executeGEPOperation(Value *Ptr, User::op_iterator I,
std::cerr << "Out of range memory access to element #" << Idx
<< " of a " << AT->getNumElements() << " element array."
<< " Subscript #" << *I << "\n";
- // Get outta here!!!
- siglongjmp(SignalRecoverBuffer, SIGTRAP);
+ abort();
}
Ty = ST->getElementType();
@@ -1006,17 +981,7 @@ void Interpreter::executeInstruction() {
// Track the number of dynamic instructions executed.
++NumDynamicInsts;
- // Set a sigsetjmp buffer so that we can recover if an error happens during
- // instruction execution...
- //
- if (int SigNo = sigsetjmp(SignalRecoverBuffer, 1)) {
- std::cout << "EXCEPTION OCCURRED [" << strsignal(SigNo) << "]\n";
- exit(1);
- }
-
- InInstruction = true;
visit(I); // Dispatch to one of the visit* methods...
- InInstruction = false;
// Reset the current frame location to the top of stack
CurFrame = ECStack.size()-1;