From 2439669c6f7944d1ca94eca645afd1932c646457 Mon Sep 17 00:00:00 2001 From: Jeff Cohen Date: Tue, 7 Feb 2006 05:29:44 +0000 Subject: 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 --- llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp') diff --git a/llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp b/llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp index 2dba4d694b6..af23bf11beb 100644 --- a/llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp +++ b/llvm/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; } -- cgit v1.2.3