From: Mattias EngdegÄrd <mattiase@acm.org>
Date: Sun, 5 Feb 2023 11:27:32 +0000 (+0100)
Subject: Fix misleading LAP optimiser debug log message
X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0f4c7060e46d279b0da315a8d0961225a7eefa6a;p=emacs.git

Fix misleading LAP optimiser debug log message

* lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode):
Correct message in a conditional jump threading rule.
---

diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el
index feff233998d..e0c769c7e60 100644
--- a/lisp/emacs-lisp/byte-opt.el
+++ b/lisp/emacs-lisp/byte-opt.el
@@ -2368,9 +2368,11 @@ If FOR-EFFECT is non-nil, the return value is assumed to be of no importance."
 		          (eq (car tmp) 'byte-goto))
                       (not (eq (cdr tmp) (cdr lap0)))
                       (progn
-                        ;; FIXME: inaccurate log message when lap0 = goto-if-*
 	                (byte-compile-log-lap "  %s [%s]\t-->\t%s"
-                                              (car lap0) tmp tmp)
+                                              (car lap0) tmp
+                                              (if (eq (car tmp) 'byte-return)
+                                                  tmp
+                                                (cons (car lap0) (cdr tmp))))
 	                (when (eq (car tmp) 'byte-return)
 	                  (setcar lap0 'byte-return))
 	                (setcdr lap0 (cdr tmp))