Fix problem next'ing over an external method
authorChris Lattner <sabre@nondot.org>
Mon, 29 Oct 2001 14:08:33 +0000 (14:08 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 29 Oct 2001 14:08:33 +0000 (14:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1027 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/Interpreter/Execution.cpp

index 1d7ec7aa8ee8788cce3562543fb1588eeafd2e18..9d07d2dd1a72c16ab5b33dd41b107dd1c33a172c 100644 (file)
@@ -894,6 +894,7 @@ void Interpreter::nextInstruction() {  // Do the 'next' command
   // If this is a call instruction, step over the call instruction...
   // TODO: ICALL, CALL WITH, ...
   if ((*ECStack.back().CurInst)->getOpcode() == Instruction::Call) {
+    unsigned StackSize = ECStack.size();
     // Step into the function...
     if (executeInstruction()) {
       // Hit a breakpoint, print current instruction, then return to user...
@@ -902,8 +903,11 @@ void Interpreter::nextInstruction() {  // Do the 'next' command
       return;
     }
 
-    // Finish executing the function...
-    finish();
+    // If we we able to step into the function, finish it now.  We might not be
+    // able the step into a function, if it's external for example.
+    if (ECStack.size() != StackSize)
+      finish(); // Finish executing the function...
+
   } else {
     // Normal instruction, just step...
     stepInstruction();