From 51f100753cc87ae7f57705a18837bb08839cf701 Mon Sep 17 00:00:00 2001 From: Brian Gaeke Date: Fri, 13 Feb 2004 05:48:00 +0000 Subject: The Interpreter was failing the AtExit UnitTest. This fixes it. llvm-svn: 11367 --- llvm/lib/ExecutionEngine/Interpreter/Execution.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'llvm/lib/ExecutionEngine/Interpreter/Execution.cpp') diff --git a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp index 57ae6215456..5379c04fbf6 100644 --- a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp +++ b/llvm/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); } -- cgit v1.2.3