Mercurial > octave
diff libinterp/parse-tree/pt-assign.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 | b442ec6dda5c |
line wrap: on
line diff
--- a/libinterp/parse-tree/pt-assign.cc Wed Sep 04 12:17:46 2019 -0400 +++ b/libinterp/parse-tree/pt-assign.cc Wed Sep 04 12:17:50 2019 -0400 @@ -81,15 +81,15 @@ { try { - unwind_protect frame; - octave_lvalue ult = m_lhs->lvalue (tw); std::list<octave_lvalue> lvalue_list; lvalue_list.push_back (ult); - frame.add_method (tw, &tree_evaluator::set_lvalue_list, - tw.lvalue_list ()); + unwind_action act ([&tw] (const std::list<octave_lvalue> *lvl) + { + tw.set_lvalue_list (lvl); + }, tw.lvalue_list ()); tw.set_lvalue_list (&lvalue_list); if (ult.numel () != 1) @@ -181,12 +181,12 @@ if (m_rhs) { - unwind_protect frame; - std::list<octave_lvalue> lvalue_list = tw.make_lvalue_list (m_lhs); - frame.add_method (tw, &tree_evaluator::set_lvalue_list, - tw.lvalue_list ()); + unwind_action act ([&tw] (const std::list<octave_lvalue> *lvl) + { + tw.set_lvalue_list (lvl); + }, tw.lvalue_list ()); tw.set_lvalue_list (&lvalue_list); octave_idx_type n_out = 0;