From a70e54f6f7a6e711bcc49fce4e117d9c3e9d71a1 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Sun, 8 Sep 2019 20:16:09 +0200 Subject: [PATCH] some error handling in compile_function --- src/comp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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); } -- 2.39.5