always release contex even in case of failure

This commit is contained in:
Andrea Corallo 2019-09-01 12:52:05 +02:00 committed by Andrea Corallo
parent 90425b6d4b
commit 76021e1e06

View 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)