From 96e1a5efb3bdeb9e70f7ea6030514e83e6ae8da1 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Sun, 16 Jun 2019 11:59:11 +0200 Subject: [PATCH] fix consp --- src/comp.c | 17 ++++++++++------- test/src/comp-tests.el | 4 ++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/comp.c b/src/comp.c index f3fd8dc16bb..7bdf1a8615c 100644 --- a/src/comp.c +++ b/src/comp.c @@ -495,13 +495,13 @@ emit_TAGGEDP (gcc_jit_rvalue *obj, unsigned tag) static gcc_jit_rvalue * emit_VECTORLIKEP (gcc_jit_rvalue *obj) { - return emit_TAGGEDP(obj, Lisp_Vectorlike); + return emit_TAGGEDP (obj, Lisp_Vectorlike); } static gcc_jit_rvalue * emit_CONSP (gcc_jit_rvalue *obj) { - return emit_TAGGEDP(obj, Lisp_Cons); + return emit_TAGGEDP (obj, Lisp_Cons); } static gcc_jit_rvalue * @@ -1332,11 +1332,14 @@ compile_f (const char *f_name, ptrdiff_t bytestr_length, CASE_CALL_NARGS (symbolp, 1); case Bconsp: - gcc_jit_block_add_assignment ( - comp.bblock->gcc_bb, - NULL, - TOS, - emit_CONSP(gcc_jit_lvalue_as_rvalue (TOS))); + POP1; + res = emit_cast (comp.bool_type, + emit_CONSP (args[0])); + res = gcc_jit_context_new_call (comp.ctxt, + NULL, + comp.bool_to_lisp_obj, + 1, &res); + PUSH_RVAL (res); break; CASE_CALL_NARGS (stringp, 1); diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index d7e6954455b..99dce77dc29 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -278,8 +278,8 @@ ;; Bconsp (consp x)) - ;; (byte-compile #'comp-tests-consp-f) - ;; (native-compile #'comp-tests-consp-f) + (byte-compile #'comp-tests-consp-f) + (native-compile #'comp-tests-consp-f) (should (eq (comp-tests-consp-f '(1)) t)) (should (eq (comp-tests-consp-f 1) nil))) -- 2.39.5