From fca675dae325a974c625893fb0ad1aa88abeab8f Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Sun, 8 Sep 2019 16:31:53 +0200 Subject: [PATCH] fix varset and add a test --- lisp/emacs-lisp/comp.el | 2 +- test/src/comp-test-funcs.el | 5 ++++- test/src/comp-tests.el | 7 +++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 2e98560e8f4..48e22528072 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -647,7 +647,7 @@ the annotation emission." (byte-varset (comp-emit (comp-call 'set_internal (make-comp-mvar :constant arg) - (comp-slot)))) + (comp-slot-next)))) (byte-varbind ;; Verify (comp-emit (comp-call 'specbind (make-comp-mvar :constant arg) diff --git a/test/src/comp-test-funcs.el b/test/src/comp-test-funcs.el index b92716739b9..4fc62482a0d 100644 --- a/test/src/comp-test-funcs.el +++ b/test/src/comp-test-funcs.el @@ -50,8 +50,11 @@ (defun comp-tests-cons-cdr-f (x) (cdr (cons 'foo x))) -(defun comp-tests-varset-f () +(defun comp-tests-varset0-f () (setq comp-tests-var1 55)) +(defun comp-tests-varset1-f () + (setq comp-tests-var1 66) + 4) (defun comp-tests-length-f () (length '(1 2 3))) diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index 47ae7899c69..331e1cfed16 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -71,8 +71,11 @@ (ert-deftest comp-tests-varset () "Testing varset." - (comp-tests-varset-f) - (should (= comp-tests-var1 55))) + (comp-tests-varset0-f) + (should (= comp-tests-var1 55)) + + (should (= (comp-tests-varset1-f) 4)) + (should (= comp-tests-var1 66))) (ert-deftest comp-tests-length () "Testing length." -- 2.39.5