diff libinterp/parse-tree/pt-idx.cc @ 27373:25627c524ad8

where possible, use new unwind-protect classes in evaluator Files affected: pt-assign.cc, pt-cell.cc, pt-eval.cc, and pt-idx.cc.
author John W. Eaton <jwe@octave.org>
date Wed, 04 Sep 2019 12:17:50 -0400
parents fcaecdbc8d8a
children d171d356767b
line wrap: on
line diff
--- a/libinterp/parse-tree/pt-idx.cc	Wed Sep 04 12:17:46 2019 -0400
+++ b/libinterp/parse-tree/pt-idx.cc	Wed Sep 04 12:17:50 2019 -0400
@@ -481,10 +481,11 @@
 
             if (al && al->length () > 0)
               {
-                unwind_protect frame;
+                unwind_action act ([&tw] (const std::list<octave_lvalue> *lvl)
+                                   {
+                                     tw.set_lvalue_list (lvl);
+                                   }, tw.lvalue_list ());
 
-                frame.add_method (tw, &tree_evaluator::set_lvalue_list,
-                                  tw.lvalue_list ());
                 tw.set_lvalue_list (nullptr);
 
                 string_vector anm = *p_arg_nm;