From 3947037a33540fa879e5465ae25b9aec61511f85 Mon Sep 17 00:00:00 2001 From: Pip Cet Date: Mon, 20 Jun 2022 01:59:49 +0200 Subject: [PATCH] Fix bytecompiler infloop compiling infloops * lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode): Don't apply optimization if we can't change anything (bug#46906). --- 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 fc49e88f8ee..1a50c5a43af 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -2060,9 +2060,9 @@ If FOR-EFFECT is non-nil, the return value is assumed to be of no importance." ((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.39.2