Skip to content
This repository has been archived by the owner on Apr 18, 2022. It is now read-only.

Commit

Permalink
Fix issues with byte-depth while compiling while forms.
Browse files Browse the repository at this point in the history
  • Loading branch information
vibhavp committed Oct 28, 2018
1 parent 1b729ef commit c3872ca
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions lisp/emacs-lisp/bytecomp.el
Original file line number Diff line number Diff line change
Expand Up @@ -4147,6 +4147,9 @@ that suppresses all warnings during execution of BODY."
(byte-compile-maybe-guarded (list 'not clause)
(byte-compile-body (cdr (cdr (cdr form))) byte-compile--for-effect))
(byte-compile-out-tag donetag))))
;; The JIT-IR version of if leaves a value on the stack, which is why we
;; dont set byte-compile--for-effect to nil whenever IR compilation is
;; enabled.
(setq byte-compile--for-effect nil)))

(defun byte-compile-cond-vars (obj1 obj2)
Expand Down Expand Up @@ -4405,22 +4408,19 @@ Return a list of the form ((TEST . VAR) ((VALUE BODY) ...))"
(byte-compile-out 'byte-br-if depth))

(defun byte-compile-ir-while (form)
(let ((byte-compile-depth byte-compile-depth))
(byte-compile-form `(null ,(car (cdr form))))
(byte-compile-ir-block
'byte-block
'byte-end
(byte-compile-ir-br-if 0)
(byte-compile-ir-block
'byte-loop
'byte-end
(let ((old-depth byte-compile-depth))
(byte-compile-body (cdr (cdr form)) t)
(byte-compile-form (car (cdr form)))
(byte-compile-ir-br-if 0)
(cl-assert (>= byte-compile-depth old-depth))
(when (> byte-compile-depth 0)
(byte-compile-discard (- byte-compile-depth old-depth) nil)))))))
(byte-compile-form `(null ,(car (cdr form))))
(byte-compile-ir-block
'byte-block
'byte-end
(byte-compile-ir-br-if 0)
(byte-compile-ir-block
'byte-loop
'byte-end
(let ((old-depth byte-compile-depth))
(byte-compile-body (cdr (cdr form)) t)
(cl-assert (= byte-compile-depth old-depth))
(byte-compile-form (car (cdr form)))
(byte-compile-ir-br-if 0)))))

(defun byte-compile-while (form)
(if byte-compile-emit-ir
Expand Down

0 comments on commit c3872ca

Please sign in to comment.