changeset 28780:fd7839a6c59f stable

maint: merge away accidental head on stable.
author Rik <rik@octave.org>
date Tue, 22 Sep 2020 19:59:55 -0700
parents 0d6795d0373d (current diff) 2893db10b8d2 (diff)
children 39997caa42f6 0ee399c4659c
files
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/call-stack.cc	Tue Sep 22 16:13:25 2020 +0200
+++ b/libinterp/corefcn/call-stack.cc	Tue Sep 22 19:59:55 2020 -0700
@@ -72,17 +72,19 @@
 
     octave_function *fcn = nullptr;
 
-    size_t idx = size ();
+    size_t idx = m_curr_frame;
 
-    if (idx > 1 && skip_first)
+    if (idx > 0 && skip_first)
       --idx;
 
-    while (--idx)
+    while (true)
       {
         fcn = m_cs[idx]->function ();
 
-        if (fcn)
+        if (fcn || idx == 0)
           break;
+
+        --idx;
       }
 
     return fcn;