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


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#31688: closed (26.1.50; Byte compiler confuses two string
 variables)
Date: Fri, 08 Jun 2018 15:10:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 08 Jun 2018 18:09:35 +0300
with message-id <834liduxg0.fsf <at> gnu.org>
and subject line Re: bug#31688: 26.1.50; Byte compiler confuses two string variables
has caused the debbugs.gnu.org bug report #31688,
regarding 26.1.50; Byte compiler confuses two string variables
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
31688: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=31688
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Gemini Lasswell <gazally <at> runbox.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.1.50; Byte compiler confuses two string variables
Date: Sat, 02 Jun 2018 10:51:18 -0700
Here is a test which succeeds when interpreted and fails when
byte-compiled. The byte compiler is apparently confusing two string
variables, or optimizing away one of them.  I've tried it both
with and without lexical-binding with the same results.

To reproduce, save this to bug.el:

(require 'ert)
(ert-deftest test-strings-props ()
  (let* ((str1 "abcdefghij")
         (obj '(a b))
         (str2 "abcdefghij"))
    (put-text-property 0 5 'test obj str2)
    (should (equal "\"abcdefghij\"" (prin1-to-string str1)))))

Then:
C-u M-x byte-compile-file RET bug.el RET
M-x ert RET t RET

Result:

    (ert-test-failed
     ((should
       (equal "\"abcdefghij\""
	      (prin1-to-string str1)))
      :form
      (equal "\"abcdefghij\"" "#(\"abcdefghij\" 0 5 (test (a b)))")
      :value nil :explanation
      (arrays-of-different-length 12 32 "\"abcdefghij\"" "#(\"abcdefghij\" 0 5 (test (a b)))" first-mismatch-at 0)))


[Message part 3 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: psainty <at> orcon.net.nz, gazally <at> runbox.com, 31688-done <at> debbugs.gnu.org,
 npostavs <at> gmail.com, bug-gnu-emacs-bounces+psainty=orcon.net.nz <at> gnu.org
Subject: Re: bug#31688: 26.1.50; Byte compiler confuses two string variables
Date: Fri, 08 Jun 2018 18:09:35 +0300
> From: Andreas Schwab <schwab <at> linux-m68k.org>
> Date: Mon, 04 Jun 2018 19:01:16 +0200
> Cc: Gemini Lasswell <gazally <at> runbox.com>, Noam Postavsky <npostavs <at> gmail.com>,
> 	bug-gnu-emacs <bug-gnu-emacs-bounces+psainty=orcon.net.nz <at> gnu.org>,
> 	31688 <at> debbugs.gnu.org
> 
> On Jun 04 2018, Phil Sainty <psainty <at> orcon.net.nz> wrote:
> 
> > Surely consistent behaviour between compiled and uncompiled code is
> > not only desirable, but a primary goal?
> 
> Not if you are using self-modifying code.

Thanks to everyone who participated in the discussion.  I have now
added some explanation of these issues to the ELisp manual, and I'm
closing the bug report.


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.