From: Philipp <p.stephani2@gmail.com>
To: 53071@debbugs.gnu.org
Subject: bug#53071: 28.0.90; Emacs 28 regression: incorrect code generation for complex pcase forms?
Date: Wed, 12 Jan 2022 03:19:42 +0100 [thread overview]
Message-ID: <39D132B5-6B44-41F0-A618-6A68BFB5FEBF@gmail.com> (raw)
In-Reply-To: <wvr4pmp3q458.fsf@gmail.com>
> Am 07.01.2022 um 10:36 schrieb Philipp Stephani <p.stephani2@gmail.com>:
>
>
> I hit the following subtle Edebug regression in Emacs 28:
>
> Create a file /tmp/pcase-edebug.el with these contents:
>
> $ cat /tmp/pcase-edebug.el
> ;; -*- lexical-binding: t; -*-
> (require 'rx)
> (defun f (a)
> (pcase a
> ((rx bos (let q (opt (let r nonl)) (let a nonl)))
> (message "%s" a))
> ((rx bos eos)
> (message "%s" a))))
>
> Visit the file in Emacs:
>
> $ emacs -Q -l rx /tmp/pcase-edebug.el
>
> Move point into the `f' function and instrument it using C-u C-M-x.
> Then, byte-compile `f' using M-: (byte-compile 'f).
> In Emacs 28, this will generate the following warnings:
>
> Warning: Unused lexical variable `q'
> Warning: Unused lexical variable `r'
> Warning: reference to free variable ‘a’
>
> The first two are expected, the third one is not.
> Indeed, M-: (f "ab") and stepping through the code will signal an error:
>
> Symbol's value as variable is void: a
'git bisect' claims that the following commit is the culprit:
commit 1362a9fec4dff341a84c881ac17dbf1ee2cf82fd
Author: Mattias Engdegård <mattiase@acm.org>
Date: Fri Mar 5 20:21:01 2021 +0100
Make lambda-lifting work again
next prev parent reply other threads:[~2022-01-12 2:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-07 9:36 bug#53071: 28.0.90; Emacs 28 regression: incorrect code generation for complex pcase forms? Philipp Stephani
2022-01-12 2:19 ` Philipp [this message]
2022-01-12 14:10 ` Michael Heerdegen
2022-01-12 15:35 ` Mattias Engdegård
2022-01-12 16:03 ` Mattias Engdegård
2022-01-12 16:58 ` Eli Zaretskii
2022-01-12 19:09 ` Mattias Engdegård
2022-01-12 19:33 ` Eli Zaretskii
2022-01-12 19:37 ` Philipp Stephani
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=39D132B5-6B44-41F0-A618-6A68BFB5FEBF@gmail.com \
--to=p.stephani2@gmail.com \
--cc=53071@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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).