GNU bug report logs - #60974
30.0.50; byte-compile-preprocess mutates self evaluating forms in expanded macro bodies

Previous Next

Package: emacs;

Reported by: Vibhav Pant <vibhavp <at> gmail.com>

Date: Fri, 20 Jan 2023 21:25:01 UTC

Severity: normal

Found in version 30.0.50

Full log


Message #41 received at 60974 <at> debbugs.gnu.org (full text, mbox):

From: Vibhav Pant <vibhavp <at> gmail.com>
To: Mattias EngdegÄrd <mattiase <at> acm.org>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 60974 <60974 <at> debbugs.gnu.org>
Subject: Re: bug#60974: 30.0.50; byte-compile-preprocess mutates self
 evaluating forms in expanded macro bodies
Date: Thu, 02 Feb 2023 18:45:56 +0530
[Message part 1 (text/plain, inline)]
On Thu, 2023-02-02 at 13:39 +0100, Mattias EngdegÄrd wrote:
> [ trimmed emacs-devel ]
> 
> 2 feb. 2023 kl. 13.35 skrev Vibhav Pant <vibhavp <at> gmail.com>:
> 
> > Sure. Do we need to install this to the release branch? The bug
> > doesn't
> > really break anything AFAIK, so I dont think it's really a release
> > blocker.
> 
> In any case there should be a test. (Not implying that you needed to
> be reminded, of course.)
> 

I had thought of adding a test a while back, but I'm not sure how we'd
do it. The immutability of self evaluating literals is only enforced
for data in purespace. One potential way to achieve this would be a
test-case that depends on a macro defined in purespace, which expands
to a body that is not byte-compiled, but that doesn't sound like a
great approach.

Alternatively, we could define a macro, store its expanded form in a
variable and run it through `cconv-closure-convert`, checking
afterwards whether the original value changed or not. It feels a little
more reliable, but writing it might be a little tricky.

(Shameless plug for scratch/comp-static-data, which does enforce
immutability in natively compiled code, and has new tests that check
for exactly this).

-- 
Vibhav Pant
vibhavp <at> gmail.com
GPG: 7ED1 D48C 513C A024 BE3A  785F E3FB 28CB 6AB5 9598
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 2 years and 189 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.