GNU bug report logs - #31688
26.1.50; Byte compiler confuses two string variables

Previous Next

Package: emacs;

Reported by: Gemini Lasswell <gazally <at> runbox.com>

Date: Sat, 2 Jun 2018 17:53:01 UTC

Severity: normal

Tags: notabug

Found in version 26.1.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Drew Adams <drew.adams <at> oracle.com>
To: Gemini Lasswell <gazally <at> runbox.com>, Noam Postavsky <npostavs <at> gmail.com>
Cc: 31688 <at> debbugs.gnu.org
Subject: RE: bug#31688: 26.1.50; Byte compiler confuses two string variables
Date: Sat, 2 Jun 2018 17:40:47 -0700 (PDT)
> just searched the Elisp reference
> looking for any any warnings not to use destructive functions on
> literals, and didn't find anything. 

It's not really about destructive functions.

It's about the fact that you might not have two different
strings, and you should not assume that you do.

It's about `eq'.  For the Emacs byte-compiler, apparently,
multiple occurrences of a string literal in the code are
compiled to the same string object.  Thinking you have two
separate strings is the problem.  Anything you might want
to think or say about the use of "destructive" functions
follows from the fact that you have a single string.






This bug report was last modified 7 years and 67 days ago.

Previous Next


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