From 6bb3dc2a57ff07b5355642ba11f5db15587c540c Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Thu, 1 Apr 2021 03:54:34 +0200 Subject: [PATCH] avoid recompiling code when undo/redoing arguments --- src/cs_ident.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cs_ident.cc b/src/cs_ident.cc index 8a504fc..3a59b0c 100644 --- a/src/cs_ident.cc +++ b/src/cs_ident.cc @@ -132,6 +132,9 @@ void alias_impl::pop_arg() { } void alias_impl::undo_arg(ident_stack &st) { + if (p_acode) { + st.val_s.set_code(p_acode); + } st.next = p_astack; p_astack = p_astack->next; clean_code(); @@ -140,6 +143,10 @@ void alias_impl::undo_arg(ident_stack &st) { void alias_impl::redo_arg(ident_stack &st) { p_astack = st.next; clean_code(); + p_acode = st.val_s.get_code(); + if (p_acode) { + bcode_incr(p_acode->get_raw()); + } } void alias_impl::set_arg(thread_state &ts, any_value &v) {