From: Brian Gaeke Date: Fri, 13 Feb 2004 05:48:00 +0000 (+0000) Subject: The Interpreter was failing the AtExit UnitTest. This fixes it. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d8400d86dd016ae93b25465dcf3bd5513800293a;p=oota-llvm.git The Interpreter was failing the AtExit UnitTest. This fixes it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11367 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp index 57ae6215456..5379c04fbf6 100644 --- a/lib/ExecutionEngine/Interpreter/Execution.cpp +++ b/lib/ExecutionEngine/Interpreter/Execution.cpp @@ -523,6 +523,10 @@ void Interpreter::visitBinaryOperator(BinaryOperator &I) { //===----------------------------------------------------------------------===// void Interpreter::exitCalled(GenericValue GV) { + // runAtExitHandlers() assumes there are no stack frames, but + // if exit() was called, then it had a stack frame. Blow away + // the stack before interpreting atexit handlers. + ECStack.clear (); runAtExitHandlers (); exit (GV.IntVal); }