From 6761e69a2bce255bbd78e08b5c592f4de19253f5 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Sat, 9 Nov 2019 11:43:16 +0100 Subject: [PATCH] fix missing byte-save-restriction op --- lisp/emacs-lisp/comp.el | 2 +- src/comp.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 2afbae56261..813c826501f 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -932,7 +932,7 @@ the annotation emission." (comp-emit (comp-call 'record_unwind_protect_excursion))) (byte-save-window-excursion-OBSOLETE) (byte-save-restriction - (comp-call 'helper-save-restriction)) + (comp-emit (comp-call 'helper_save_restriction))) (byte-catch) ;; Obsolete (byte-unwind-protect (comp-emit (comp-call 'helper_unwind_protect (comp-slot+1)))) diff --git a/src/comp.c b/src/comp.c index 1aa0636c5b7..4afba1183f3 100644 --- a/src/comp.c +++ b/src/comp.c @@ -183,6 +183,7 @@ Lisp_Object helper_save_window_excursion (Lisp_Object v1); void helper_unwind_protect (Lisp_Object handler); Lisp_Object helper_temp_output_buffer_setup (Lisp_Object x); Lisp_Object helper_unbind_n (Lisp_Object n); +void helper_save_restriction (void); bool helper_PSEUDOVECTOR_TYPEP_XUNTAG (Lisp_Object a, enum pvec_type code); @@ -1695,6 +1696,8 @@ declare_runtime_imported_funcs (void) args[0] = comp.lisp_obj_type; ADD_IMPORTED ("helper_unbind_n", comp.lisp_obj_type, 1, args); + ADD_IMPORTED ("helper_save_restriction", comp.void_type, 0, NULL); + ADD_IMPORTED ("record_unwind_current_buffer", comp.void_type, 0, NULL); args[0] = args[1] = args[2] = comp.lisp_obj_type; @@ -3109,6 +3112,13 @@ helper_unbind_n (Lisp_Object n) return unbind_to (SPECPDL_INDEX () - XFIXNUM (n), Qnil); } +void +helper_save_restriction (void) +{ + record_unwind_protect (save_restriction_restore, + save_restriction_save ()); +} + bool helper_PSEUDOVECTOR_TYPEP_XUNTAG (Lisp_Object a, enum pvec_type code) { @@ -3194,6 +3204,9 @@ load_comp_unit (dynlib_handle_ptr handle) } else if (!strcmp (f_str, "helper_unbind_n")) { f_relocs[i] = (void *) helper_unbind_n; + } else if (!strcmp (f_str, "helper_save_restriction")) + { + f_relocs[i] = (void *) helper_save_restriction; } else if (!strcmp (f_str, "record_unwind_current_buffer")) { f_relocs[i] = (void *) record_unwind_current_buffer; -- 2.39.5