From: Andrea Corallo Date: Sun, 8 Sep 2019 18:16:09 +0000 (+0200) Subject: some error handling in compile_function X-Git-Tag: emacs-28.0.90~2727^2~1192 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a70e54f6f7a6e711bcc49fce4e117d9c3e9d71a1;p=emacs.git some error handling in compile_function --- diff --git a/src/comp.c b/src/comp.c index b6733522a10..c2bd135495e 100644 --- a/src/comp.c +++ b/src/comp.c @@ -2626,7 +2626,7 @@ define_bool_to_lisp_obj (void) static void compile_function (Lisp_Object func) { - char *c_name = (char *) SDATA (FUNCALL1 (comp-func-c-func-name, func)); + char *c_name = SSDATA (FUNCALL1 (comp-func-c-func-name, func)); Lisp_Object args = FUNCALL1 (comp-func-args, func); EMACS_INT frame_size = XFIXNUM (FUNCALL1 (comp-func-frame-size, func)); bool ncall = (FUNCALL1 (comp-nargs-p, args)); @@ -2707,6 +2707,11 @@ compile_function (Lisp_Object func) insns = XCDR (insns); } } + const char *err = gcc_jit_context_get_first_error (comp.ctxt); + if (err) + error ("Failing to compile function %s with error:%s", + SSDATA (SYMBOL_NAME (FUNCALL1 (comp-func-symbol-name, func))), + err); }