changeset 29475:0574c36a095e stable

defer clearing function vars until stack frame is deleted (bug #60137) * pt-eval.cc (tree_evaluator::execute_user_function): Don't use unwind_action object to clear local variables; they will be deleted when the containing stack frame is deleted.
author John W. Eaton <jwe@octave.org>
date Tue, 02 Mar 2021 12:32:43 -0500
parents 4ae7e80fb7c5
children c74ff452e2bb
files libinterp/parse-tree/pt-eval.cc
diffstat 1 files changed, 0 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/parse-tree/pt-eval.cc	Tue Mar 23 22:22:45 2021 +0100
+++ b/libinterp/parse-tree/pt-eval.cc	Tue Mar 02 12:32:43 2021 -0500
@@ -2751,11 +2751,6 @@
 
     unwind_protect_var<stmt_list_type> upv (m_statement_context, SC_FUNCTION);
 
-    unwind_action act1 ([] (std::shared_ptr<stack_frame> frame)
-                       {
-                         frame->clear_values ();
-                       }, m_call_stack.get_current_stack_frame ());
-
     {
       profiler::enter<octave_user_function> block (m_profiler, user_function);