bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#53071: 28.0.90; Emacs 28 regression: incorrect code generation for c


From: Michael Heerdegen
Subject: bug#53071: 28.0.90; Emacs 28 regression: incorrect code generation for complex pcase forms?
Date: Wed, 12 Jan 2022 15:10:12 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Philipp <p.stephani2@gmail.com> writes:

> '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

Not that again.  Let's CC Mattias then.

> > 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

Michael.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]