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

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

[debbugs-tracker] bug#31688: closed (26.1.50; Byte compiler confuses two


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#31688: closed (26.1.50; Byte compiler confuses two string variables)
Date: Fri, 08 Jun 2018 15:10:02 +0000

Your message dated Fri, 08 Jun 2018 18:09:35 +0300
with message-id <address@hidden>
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
address@hidden)


-- 
31688: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=31688
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- 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)))



--- End Message ---
--- Begin Message --- 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 <address@hidden>
> Date: Mon, 04 Jun 2018 19:01:16 +0200
> Cc: Gemini Lasswell <address@hidden>, Noam Postavsky <address@hidden>,
>       bug-gnu-emacs <address@hidden>,
>       address@hidden
> 
> On Jun 04 2018, Phil Sainty <address@hidden> 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.


--- End Message ---

reply via email to

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