From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#31688: 26.1.50; Byte compiler confuses two string variables Date: Sat, 2 Jun 2018 23:03:52 +0000 (UTC) Message-ID: References: <87a7sdkrft.fsf@runbox.com> <87po199id0.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1527980587 11549 195.159.176.226 (2 Jun 2018 23:03:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 2 Jun 2018 23:03:07 +0000 (UTC) Cc: 31688@debbugs.gnu.org To: Noam Postavsky , Gemini Lasswell Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 03 01:03:03 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fPFY6-0002rv-Uw for geb-bug-gnu-emacs@m.gmane.org; Sun, 03 Jun 2018 01:03:03 +0200 Original-Received: from localhost ([::1]:33007 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPFaC-0005f7-F9 for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 Jun 2018 19:05:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPFa5-0005eg-Co for bug-gnu-emacs@gnu.org; Sat, 02 Jun 2018 19:05:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fPFa2-0007Js-8T for bug-gnu-emacs@gnu.org; Sat, 02 Jun 2018 19:05:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51741) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fPFa2-0007JX-4o for bug-gnu-emacs@gnu.org; Sat, 02 Jun 2018 19:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fPFa1-0000BI-Q1 for bug-gnu-emacs@gnu.org; Sat, 02 Jun 2018 19:05:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Jun 2018 23:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31688 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 31688-submit@debbugs.gnu.org id=B31688.1527980645613 (code B ref 31688); Sat, 02 Jun 2018 23:05:01 +0000 Original-Received: (at 31688) by debbugs.gnu.org; 2 Jun 2018 23:04:05 +0000 Original-Received: from localhost ([127.0.0.1]:59638 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fPFZ7-00009o-0y for submit@debbugs.gnu.org; Sat, 02 Jun 2018 19:04:05 -0400 Original-Received: from userp2130.oracle.com ([156.151.31.86]:55678) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fPFZ5-00009J-AC for 31688@debbugs.gnu.org; Sat, 02 Jun 2018 19:04:03 -0400 Original-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w52N1XZt143916; Sat, 2 Jun 2018 23:03:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=uD0YpxzNbkaiJiaXlZ/YmFcfNgy/CezJxQotRNhB3OE=; b=gnIObzGv4W+fZIdZ/XSZGCSUYGb+WOwnMfsPYeD+Fy0wOQ6XhaW7yqZ2RFUCmlYQ4B/u WrD+1oNqi5nTXS62W6hZdP1tNMOrxVzR0PGVaDu2nSO/SDafw+Keb9sSupaycZCiTm+V FyS9R+lNmsvqbn5oMZKVuoFa8Svyfw+PlclAj/RVhLuUUvUBUzKlpLUCW/XIzA0ZWOOn AllDrD64vfadmfgIi2lAkH/XPjGn8dDPzoVNfNUxIjgn8/ncqfFICQkj12PHbKnwOmYP 95x0RmHr37w16gB+gWfrHyUfOGkl9c3w5xjtbQtTLVkzIwgM+vKc2DoZlmob99idMZVq SA== Original-Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2jbvyp0bhv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 02 Jun 2018 23:03:57 +0000 Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w52N3uLM014828 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 2 Jun 2018 23:03:56 GMT Original-Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w52N3smn016810; Sat, 2 Jun 2018 23:03:54 GMT In-Reply-To: <87po199id0.fsf@gmail.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4690.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8912 signatures=668702 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=845 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806020269 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:146881 Archived-At: > I don't think this is a bug, the compiler coalesces equal string > literals. `put-text-property' modifies the string destructively, so you > shouldn't use it on literals, for the same reason you shouldn't use > destructive operations on quoted list literals. Another example, not > dependent on compilation: >=20 > (defun foo (prop val) > (let ((s "xyz")) > (put-text-property 0 3 prop val s) > s)) >=20 > (foo 'x 1) ;=3D> #("xyz" 0 3 (x 1)) > (foo 'y 2) ;=3D> #("xyz" 0 3 (x 1 y 2)) Yes. See also this, about Common Lisp: https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node74.html A snippet of it: An additional problem with eq is that the implementation is permitted to ``collapse'' constants (or portions thereof) appearing in code to be compiled if they are equal. An object is considered to be a constant in code to be compiled if it is a self-evaluating form or is contained in a quote form. This is why (eq "Foo" "Foo") might be true or false; in interpreted code it would normally be false, because reading in the form (eq "Foo" "Foo") would construct distinct strings for the two arguments to eq, but the compiler might choose to use the same identical string or two distinct copies as the two arguments in the call to eq.