From 5852cbe0bf7b2e70636d252cbf5bf545b6a5cd39 Mon Sep 17 00:00:00 2001 From: Pip Cet Date: Wed, 3 Mar 2021 21:37:13 +0000 Subject: [PATCH] Fix bytecompiler infloop compiling infloops (bug#46906) * lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode): Don't apply optimization if we can't change anything. --- lisp/emacs-lisp/byte-opt.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index b51ba801552d6..aedfde6c0c6ab 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -2012,9 +2012,9 @@ byte-optimize-lapcode ((and (memq (car lap0) byte-goto-ops) (memq (car (setq tmp (nth 1 (memq (cdr lap0) lap)))) '(byte-goto byte-return))) - (cond ((and (not (eq tmp lap0)) - (or (eq (car lap0) 'byte-goto) - (eq (car tmp) 'byte-goto))) + (cond ((and (or (eq (car lap0) 'byte-goto) + (eq (car tmp) 'byte-goto)) + (not (eq (cdr tmp) (cdr lap0)))) (byte-compile-log-lap " %s [%s]\t-->\t%s" (car lap0) tmp tmp) (if (eq (car tmp) 'byte-return) -- 2.30.1