]> git.eshelyaron.com Git - emacs.git/commitdiff
always release contex even in case of failure
authorAndrea Corallo <andrea_corallo@yahoo.it>
Sun, 1 Sep 2019 10:52:05 +0000 (12:52 +0200)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:37:41 +0000 (11:37 +0100)
lisp/emacs-lisp/comp.el

index 631003da1dd795a28c9747a4fc118a7fbd918f72..e9f9cd2db4578a1a22784cc607961fd7ae9fa275 100644 (file)
@@ -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)