]> git.eshelyaron.com Git - emacs.git/commitdiff
fix varset and add a test
authorAndrea Corallo <akrl@sdf.org>
Sun, 8 Sep 2019 14:31:53 +0000 (16:31 +0200)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:37:45 +0000 (11:37 +0100)
lisp/emacs-lisp/comp.el
test/src/comp-test-funcs.el
test/src/comp-tests.el

index 2e98560e8f4f61c7143d57d8a713d3e7770860cc..48e22528072397b172055c1d32de3ec534aab13e 100644 (file)
@@ -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)
index b92716739b978b2656835231844c2f63dbc8b93e..4fc62482a0d65919f707e25a0546cefc0934ff90 100644 (file)
 (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)))
index 47ae7899c691cef0e8d19f110403f87ba62fd791..331e1cfed16862b08c99c108a1d117b04b97b017 100644 (file)
 
 (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."