# HG changeset patch # User John W. Eaton # Date 1605318199 18000 # Node ID be19672a3c494af3f2c4a47aaaef42690ef271c6 # Parent c170ff385070da243a9a5638997722dc417c92ed# Parent 336356206de70e2a92a5038c213f54b4b6234bc9 maint: merge stable to default. diff -r c170ff385070 -r be19672a3c49 libinterp/corefcn/call-stack.cc --- a/libinterp/corefcn/call-stack.cc Fri Nov 13 16:26:13 2020 -0500 +++ b/libinterp/corefcn/call-stack.cc Fri Nov 13 20:43:19 2020 -0500 @@ -1103,11 +1103,6 @@ return octave_value (); } - void call_stack::clear_current_frame_values (void) - { - m_cs[m_curr_frame]->clear_values (); - } - void call_stack::display (void) const { std::ostream& os = octave_stdout; diff -r c170ff385070 -r be19672a3c49 libinterp/corefcn/call-stack.h --- a/libinterp/corefcn/call-stack.h Fri Nov 13 16:26:13 2020 -0500 +++ b/libinterp/corefcn/call-stack.h Fri Nov 13 20:43:19 2020 -0500 @@ -293,8 +293,6 @@ bool have_regexp, bool return_list, bool verbose, const std::string& msg = ""); - void clear_current_frame_values (void); - void display (void) const; void set_auto_fcn_var (stack_frame::auto_var_type avt, diff -r c170ff385070 -r be19672a3c49 libinterp/corefcn/stack-frame.cc --- a/libinterp/corefcn/stack-frame.cc Fri Nov 13 16:26:13 2020 -0500 +++ b/libinterp/corefcn/stack-frame.cc Fri Nov 13 20:43:19 2020 -0500 @@ -1074,14 +1074,13 @@ return new scope_stack_frame (tw, scope, index, parent_link, static_link); } - // This function is only implemented for user_fcn stack frames and - // only called for those objects using unwind_protect and the - // call_stack::clear_current_frame_values function. Anything else - // indicates an error in the implementation. + // This function is only implemented and should only be called for + // user_fcn stack frames. Anything else indicates an error in the + // implementation, but we'll simply warn if that happens. void stack_frame::clear_values (void) { - panic_impossible (); + warning ("invalid call to stack_frame::clear_values; please report"); } symbol_info_list diff -r c170ff385070 -r be19672a3c49 libinterp/parse-tree/pt-eval.cc --- a/libinterp/parse-tree/pt-eval.cc Fri Nov 13 16:26:13 2020 -0500 +++ b/libinterp/parse-tree/pt-eval.cc Fri Nov 13 20:43:19 2020 -0500 @@ -2861,12 +2861,12 @@ // Evaluate the commands that make up the function. - unwind_protect_var - upv (m_statement_context, SC_FUNCTION); - - unwind_action act1 ([=] () { - m_call_stack.clear_current_frame_values (); - }); + unwind_protect_var upv (m_statement_context, SC_FUNCTION); + + unwind_action act1 ([] (std::shared_ptr frame) + { + frame->clear_values (); + }, m_call_stack.get_current_stack_frame ()); tree_statement_list *cmd_list = user_function.body ();