From 76021e1e06c5c1af05b658310505da333bc0c214 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Sun, 1 Sep 2019 12:52:05 +0200 Subject: [PATCH] always release contex even in case of failure --- lisp/emacs-lisp/comp.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 631003da1dd..e9f9cd2db45 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -886,10 +886,11 @@ the annotation emission." comp-passes) ;; Once we have the final LIMPLE we jump into C. (comp--init-ctxt) - (comp-add-func-to-ctxt func) - (comp-compile-ctxt-to-file (symbol-name func-symbol-name)) - ;; (comp-compile-and-load-ctxt) - (comp--release-ctxt))) + (unwind-protect + (progn + (comp-add-func-to-ctxt func) + (comp-compile-ctxt-to-file (symbol-name func-symbol-name))) + (comp--release-ctxt)))) (error "Trying to native compile something not a function"))) (provide 'comp) -- 2.39.5