Handle execution entrypoints with non-integer return types.
authorDan Gohman <gohman@apple.com>
Fri, 18 Jun 2010 02:01:10 +0000 (02:01 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 18 Jun 2010 02:01:10 +0000 (02:01 +0000)
Fix from Russel Power in PR7284.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106271 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/Interpreter/Execution.cpp

index 0748b546081ba09ccdf4ab042be61efe393e2065..59ebe6e2a8850eec351f92cfd58c2597d83ea3a9 100644 (file)
@@ -591,7 +591,7 @@ void Interpreter::popStackAndReturnValueToCaller(const Type *RetTy,
   ECStack.pop_back();
 
   if (ECStack.empty()) {  // Finished main.  Put result into exit code...
-    if (RetTy && RetTy->isIntegerTy()) {          // Nonvoid return type?
+    if (RetTy && !RetTy->isVoidTy()) {          // Nonvoid return type?
       ExitValue = Result;   // Capture the exit value of the program
     } else {
       memset(&ExitValue.Untyped, 0, sizeof(ExitValue.Untyped));