From 2b48e5f979610de9c92df24d7cc6c47b6d8d83da Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Fri, 24 May 2019 14:10:09 +0200 Subject: [PATCH] Baref --- src/comp.c | 6 +++++- test/src/comp-tests.el | 9 +++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/comp.c b/src/comp.c index 198343c057c..bafb980dc69 100644 --- a/src/comp.c +++ b/src/comp.c @@ -612,9 +612,13 @@ compile_f (const char *f_name, ptrdiff_t bytestr_length, res = jit_emit_call ("Flength", comp.lisp_obj_type, 1, args); PUSH (gcc_jit_lvalue_as_rvalue (res)); break; + case Baref: - printf("Baref\n"); + POP2; + res = jit_emit_call ("Faref", comp.lisp_obj_type, 2, args); + PUSH (gcc_jit_lvalue_as_rvalue (res)); break; + case Baset: printf("Baset\n"); break; diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index 32d5b50e13d..be131f7de76 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -85,6 +85,15 @@ (should (= (comp-tests-length-f) 3))) +(ert-deftest comp-tests-aref () + "Testing aref." + (defun comp-tests-aref-f () + (aref [1 2 3] 2)) + (byte-compile #'comp-tests-aref-f) + (native-compile #'comp-tests-aref-f) + + (should (= (comp-tests-aref-f) 3))) + (ert-deftest comp-tests-ffuncall () "Testing varset." (defun comp-tests-ffuncall-callee-f (x y z) -- 2.39.5