]> git.eshelyaron.com Git - emacs.git/commitdiff
Baref
authorAndrea Corallo <andrea_corallo@yahoo.it>
Fri, 24 May 2019 12:10:09 +0000 (14:10 +0200)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:33:38 +0000 (11:33 +0100)
src/comp.c
test/src/comp-tests.el

index 198343c057cc3ae15a09c286009b8f844104c87a..bafb980dc691b0ccac53e37dbbfebe40fa21afce 100644 (file)
@@ -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;
index 32d5b50e13d96dd30b6fcbbb21e00e27f21c7496..be131f7de768d0a1966cc4fc2e22307212e8ae5a 100644 (file)
 
   (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)