summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/Interpreter/Execution.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
commit2439669c6f7944d1ca94eca645afd1932c646457 (patch)
treed4f08b6d617a8a0e59437ae6439f5bce90e48ef1 /llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
parent69e849014c0d17f97a5c22069a587e852e626395 (diff)
downloadbcm5719-llvm-2439669c6f7944d1ca94eca645afd1932c646457.tar.gz
bcm5719-llvm-2439669c6f7944d1ca94eca645afd1932c646457.zip
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. llvm-svn: 26031
Diffstat (limited to 'llvm/lib/ExecutionEngine/Interpreter/Execution.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/Interpreter/Execution.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
index a41d12af4fd..4104ff36365 100644
--- a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
@@ -553,7 +553,7 @@ void Interpreter::exitCalled(GenericValue GV) {
/// Pop the last stack frame off of ECStack and then copy the result
/// back into the result variable if we are not returning void. The
-/// result variable may be the ExitCode, or the Value of the calling
+/// result variable may be the ExitValue, or the Value of the calling
/// CallInst if there was a previous stack frame. This method may
/// invalidate any ECStack iterators you have. This method also takes
/// care of switching to the normal destination BB, if we are returning
@@ -566,9 +566,9 @@ void Interpreter::popStackAndReturnValueToCaller (const Type *RetTy,
if (ECStack.empty()) { // Finished main. Put result into exit code...
if (RetTy && RetTy->isIntegral()) { // Nonvoid return type?
- ExitCode = Result.IntVal; // Capture the exit code of the program
+ ExitValue = Result; // Capture the exit value of the program
} else {
- ExitCode = 0;
+ memset(&ExitValue, 0, sizeof(ExitValue));
}
} else {
// If we have a previous stack frame, and we have a previous call,
OpenPOWER on IntegriCloud