From: Pip Cet <pipcet@gmail.com>
To: 46906@debbugs.gnu.org
Subject: bug#46906: 28.0.50; byte compiler infloops trying to compile infloop
Date: Wed, 3 Mar 2021 21:44:02 +0000 [thread overview]
Message-ID: <CAOqdjBfWDRbiDM5HxvQXB6JjYJ=+7Kz9ANrcreGbRQzDYySV-g@mail.gmail.com> (raw)
In-Reply-To: <CAOqdjBegzojbh5YreKNm8r1mFqzSDLX1Lne1zFg=y3w5xoqx6g@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 399 bytes --]
On Wed, Mar 3, 2021 at 9:15 PM Pip Cet <pipcet@gmail.com> wrote:
>
> Recipe in emacs -Q:
>
> In *scratch*, evaluate:
>
> (byte-compile (lambda (x)
> (if x (f))
> (while t)))
>
> Expected result:
>
> A (fairly useless) bytecode object
>
> Actual result:
>
> A spinning hourglass.
Seems to be a fairly obvious bug in byte-opt.el, patch attached.
Okay to commit?
Pip
[-- Attachment #2: 0001-Fix-bytecompiler-infloop-compiling-infloops-bug-4690.patch --]
[-- Type: text/x-patch, Size: 1154 bytes --]
From 5852cbe0bf7b2e70636d252cbf5bf545b6a5cd39 Mon Sep 17 00:00:00 2001
From: Pip Cet <pipcet@gmail.com>
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
next prev parent reply other threads:[~2021-03-03 21:44 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-03 21:14 bug#46906: 28.0.50; byte compiler infloops trying to compile infloop Pip Cet
2021-03-03 21:44 ` Pip Cet [this message]
2021-03-03 23:33 ` Andy Moreton
2021-03-04 7:17 ` Pip Cet
2021-03-04 9:15 ` Juri Linkov
2021-03-04 10:19 ` Pip Cet
2021-03-04 11:16 ` Lars Ingebrigtsen
2021-03-04 12:15 ` Pip Cet
2021-03-05 13:16 ` Lars Ingebrigtsen
2021-03-04 17:58 ` Juri Linkov
2021-03-04 18:50 ` Pip Cet
2021-03-05 13:17 ` Lars Ingebrigtsen
2022-06-20 0:00 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAOqdjBfWDRbiDM5HxvQXB6JjYJ=+7Kz9ANrcreGbRQzDYySV-g@mail.gmail.com' \
--to=pipcet@gmail.com \
--cc=46906@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.