changeset 28779:1be026ad8e61

maint: merge away accidental head.
author Rik <rik@octave.org>
date Tue, 22 Sep 2020 19:59:21 -0700
parents 471960b47afb (current diff) d3643467d235 (diff)
children 39997caa42f6
files
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/call-stack.cc	Tue Sep 22 14:10:59 2020 -0700
+++ b/libinterp/corefcn/call-stack.cc	Tue Sep 22 19:59:21 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;