aboutsummaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/Interpreter/Interpreter.cpp
diff options
context:
space:
mode:
authorJeff Cohen <jeffc@jolt-lang.org>2006-02-07 05:29:44 +0000
committerJeff Cohen <jeffc@jolt-lang.org>2006-02-07 05:29:44 +0000
commit8c9191c644cf8c3aceac8e0d1ddc72273355588c (patch)
tree2982cbadc6785aeadebe45d9f05c36d88089259d /lib/ExecutionEngine/Interpreter/Interpreter.cpp
parent68835dd5119150383938c701fc223077d2bc1e25 (diff)
The interpreter assumes that the caller of runFunction() must be lli, and
therefore the function being called must be a main() returning an int. The consequences when these assumptions are false are not good, so don't assume them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26031 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/Interpreter/Interpreter.cpp')
-rw-r--r--lib/ExecutionEngine/Interpreter/Interpreter.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/ExecutionEngine/Interpreter/Interpreter.cpp b/lib/ExecutionEngine/Interpreter/Interpreter.cpp
index 2dba4d694b..af23bf11be 100644
--- a/lib/ExecutionEngine/Interpreter/Interpreter.cpp
+++ b/lib/ExecutionEngine/Interpreter/Interpreter.cpp
@@ -50,10 +50,11 @@ ExecutionEngine *Interpreter::create(Module *M, IntrinsicLowering *IL) {
//
Interpreter::Interpreter(Module *M, bool isLittleEndian, bool isLongPointer,
IntrinsicLowering *il)
- : ExecutionEngine(M), ExitCode(0),
+ : ExecutionEngine(M),
TD("lli", isLittleEndian, isLongPointer ? 8 : 4, isLongPointer ? 8 : 4,
isLongPointer ? 8 : 4), IL(il) {
+ memset(&ExitValue, 0, sizeof(ExitValue));
setTargetData(TD);
// Initialize the "backend"
initializeExecutionEngine();
@@ -100,8 +101,6 @@ Interpreter::runFunction(Function *F,
// Start executing the function.
run();
- GenericValue rv;
- rv.IntVal = ExitCode;
- return rv;
+ return ExitValue;
}