From: Andrea Corallo Date: Fri, 24 May 2019 13:00:34 +0000 (+0200) Subject: add symbol-value X-Git-Tag: emacs-28.0.90~2727^2~1531 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=17807af213da9eb08507d47dff142a1f8672b4e7;p=emacs.git add symbol-value --- diff --git a/src/comp.c b/src/comp.c index 2e7ef4f077a..33528f98004 100644 --- a/src/comp.c +++ b/src/comp.c @@ -630,8 +630,11 @@ compile_f (const char *f_name, ptrdiff_t bytestr_length, break; case Bsymbol_value: - printf("Bsymbol_value\n"); + POP1; + res = jit_emit_call ("Fsymbol_value", comp.lisp_obj_type, 1, args); + PUSH (gcc_jit_lvalue_as_rvalue (res)); break; + case Bsymbol_function: printf("Bsymbol_function\n"); break; diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index 769cd086b5a..36344d361fc 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -96,6 +96,17 @@ (should (= (comp-tests-aref-aset-f) 100))) +(ert-deftest comp-tests-symbol-value () + "Testing aref and aset." + (defvar comp-tests-var2 3) + (defun comp-tests-symbol-value-f () + (symbol-value 'comp-tests-var2)) + (byte-compile #'comp-tests-symbol-value-f) + (native-compile #'comp-tests-symbol-value-f) + + (should (= (comp-tests-symbol-value-f) 3))) + + (ert-deftest comp-tests-ffuncall () "Testing varset." (defun comp-tests-ffuncall-callee-f (x y z)