From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Vibhav Pant Newsgroups: gmane.emacs.devel Subject: Re: bug#60974: 30.0.50; byte-compile-preprocess mutates self evaluating forms in expanded macro bodies Date: Wed, 01 Feb 2023 13:11:59 +0530 Message-ID: <22ab766cb75ceedac14976e02aebe02711ef6aad.camel@gmail.com> References: <6eb5f27bf591c3d52766d8b9da46e7301f2ff0ab.camel@gmail.com> <5ccd0d1f9f64a5fd20e5403a07b06d6074b6c8f6.camel@gmail.com> <2d72943db9995af6a98744f4a4da3cef98773b86.camel@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-PcWen83cR674IjG08Lw4" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26225"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.46.3 Cc: 60974@debbugs.gnu.org, emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Feb 01 08:42:28 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pN7lE-0006ia-By for ged-emacs-devel@m.gmane-mx.org; Wed, 01 Feb 2023 08:42:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pN7kz-0007vG-GZ; Wed, 01 Feb 2023 02:42:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pN7ky-0007ua-1t for emacs-devel@gnu.org; Wed, 01 Feb 2023 02:42:12 -0500 Original-Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pN7kw-0006ei-6x for emacs-devel@gnu.org; Wed, 01 Feb 2023 02:42:11 -0500 Original-Received: by mail-wm1-x332.google.com with SMTP id bg26so6116428wmb.0 for ; Tue, 31 Jan 2023 23:42:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:references:in-reply-to:date:cc:to:from :subject:message-id:from:to:cc:subject:date:message-id:reply-to; bh=+9NY2QxDBaavzI0iBxAechw3P5jMmtE7u1NIDokELeM=; b=V9Bk3slVCyQHFuhHKe1OpbtXeXi21Qfj35sj8B52efpd5WfFJ6d2RGDzyd8LQimbkH co1znGc7yI1U/L4/fAGHKwta2bXoQxHySanTWjnqQ39fxqA6Q2vI8myzx+fg4tkyIplv a6ipmFnFaGd55Xw9jvUVQQ8YywKyIx1zITnhCc4Hp1jRJ5Ie2KKt1ZmN6WRoX4BbuA0V +UVSk+xDU8WzlVsNPIOpGBj0XTZfZQwcdR5LP7l39HDBliMAlXrM2KXM7KrIJmQWig79 g5kv2NO81UBR8hQuNUoTv6STtv6ptxIqJYVdLvvas32uBO/AtIK6zE0I78tYZqyWRh4N /Lqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:references:in-reply-to:date:cc:to:from :subject:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+9NY2QxDBaavzI0iBxAechw3P5jMmtE7u1NIDokELeM=; b=MFC+YHQr7ieAx90fuTztOrZEBu6b2Kqnmft93M6WncbnrcdwLNR7jCqSozcOuQ+hoi hVOlztqZNEEoIjyvUr1oI6H0V5CFKsjlrIMnOXH/1qdmwthILP5JyQ9Vtqiv4DmcmhGN g//uEZ71Qk6g3e9LN99Hv6kWDqNigF7NMbsiikpHCiARysbpIWSTXh02NX9onfRoGKcX ItM02MekVbLPhY9+YENqAjprfFR+tBQEAqwl3SMA3KFLatzdUytjXrObL/LiXwkeSWeE Vicxo87nPIHtyltq9wAU4QTMqPE2tpxm4Ys5HiMZLwCjWG7ciPcCEtDd3W9zFP5/5Goj gAsg== X-Gm-Message-State: AO0yUKWxFWD7wGm6DxUVSFsDBmvLJqb5i4+0ySSxMBceW5TVhiOT0w2x VXLKV5rOd4rVWxoxnlIkq6I= X-Google-Smtp-Source: AK7set+8+JBqhT2kvToCYEBHsQ+upuaK6v+zUGB3RU1ZKBgsz/saa/dwwVuyu9SD95ywlpMpfmBUoA== X-Received: by 2002:a7b:cc83:0:b0:3de:25f2:3aee with SMTP id p3-20020a7bcc83000000b003de25f23aeemr1022784wma.31.1675237328359; Tue, 31 Jan 2023 23:42:08 -0800 (PST) Original-Received: from vibhavp-mbp.local ([182.69.182.68]) by smtp.gmail.com with ESMTPSA id z14-20020a5d4d0e000000b002bde537721dsm16409672wrt.20.2023.01.31.23.42.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 23:42:07 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=vibhavp@gmail.com; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:302848 Archived-At: --=-PcWen83cR674IjG08Lw4 Content-Type: multipart/mixed; boundary="=-X/9QhZyWMN+vY9a98Cui" --=-X/9QhZyWMN+vY9a98Cui Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2023-01-31 at 09:34 -0500, Stefan Monnier wrote: > > > > Ah, right. Theother way I could think of a fix is setq-ing > > > > `form` > > > > to a > > > > shallow copy of the original form, with only the place(s) > > > > changed. > > > > This > > > > patch tries to do that by using `pcase-let` to destructure > > > > forms. > > >=20 > > > Hmm... yes, that's closer.=C2=A0 It's pretty ugly, tho. > > > Yet it's hard to make it less ugly here because the > > > `cconv-freevars-alist` really depends on `eq` equality. > > >=20 > > > Maybe we should pass `cif` to `cconv--convert-function` (or maybe > > > even > > > move most of that `cconv--interactive-form-funs`-handling to that > > > function) and arrange for that function to do the > > > "non-side-effecting-equivalent-of" (setf (cadr (car bf)) form)? > > >=20 > > >=20 > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Stefan > > >=20 > >=20 > > I tried to shift the `cif` related bits to `cconc--convert- > > function`, > > but my understanding of cconv.el isn't that great, so I wasn't > > successful at doing that :( Should I add a TODO to the change for > > the > > future? >=20 > Yes, please, >=20 >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Stefan >=20 Done, thoughts? --=20 Vibhav Pant vibhavp@gmail.com GPG: 7ED1 D48C 513C A024 BE3A 785F E3FB 28CB 6AB5 9598 --=-X/9QhZyWMN+vY9a98Cui Content-Disposition: attachment; filename="60974-3.patch" Content-Transfer-Encoding: base64 Content-Type: text/x-patch; name="60974-3.patch"; charset="UTF-8" ZGlmZiAtLWdpdCBhL2xpc3AvZW1hY3MtbGlzcC9jY29udi5lbCBiL2xpc3AvZW1hY3MtbGlzcC9j Y29udi5lbAppbmRleCBlNzE1YmQ5MGEwMC4uNWE2YWU3OThjOTMgMTAwNjQ0Ci0tLSBhL2xpc3Av ZW1hY3MtbGlzcC9jY29udi5lbAorKysgYi9saXNwL2VtYWNzLWxpc3AvY2NvbnYuZWwKQEAgLTQ3 NywyMCArNDc3LDQwIEBAIGNjb252LWNvbnZlcnQKICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBicmFuY2gpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29u ZC1mb3JtcykpKQogCi0gICAgKGAoZnVuY3Rpb24gKGxhbWJkYSAsYXJncyAuICxib2R5KSAuICxf KQorICAgIChgKGZ1bmN0aW9uIChsYW1iZGEgLGFyZ3MgLiAsYm9keSkgLiAscmVzdCkKICAgICAg KGxldCogKChkb2NzdHJpbmcgKGlmIChlcSA6ZG9jdW1lbnRhdGlvbiAoY2FyLXNhZmUgKGNhciBi b2R5KSkpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY2NvbnYtY29udmVydCAoY2FkciAo cG9wIGJvZHkpKSBlbnYgZXh0ZW5kKSkpCiAgICAgICAgICAgICAoYmYgKGlmIChzdHJpbmdwIChj YXIgYm9keSkpIChjZHIgYm9keSkgYm9keSkpCiAgICAgICAgICAgICAoaWYgKHdoZW4gKGVxICdp bnRlcmFjdGl2ZSAoY2FyLXNhZmUgKGNhciBiZikpKQogICAgICAgICAgICAgICAgICAgKGdldGhh c2ggZm9ybSBjY29udi0taW50ZXJhY3RpdmUtZm9ybS1mdW5zKSkpCiAgICAgICAgICAgICAoY2lm ICh3aGVuIGlmIChjY29udi1jb252ZXJ0IGlmIGVudiBleHRlbmQpKSkKLSAgICAgICAgICAgIChf IChwY2FzZSBjaWYKLSAgICAgICAgICAgICAgICAgKGAjJyhsYW1iZGEgKCkgLGZvcm0pIChzZXRm IChjYWRyIChjYXIgYmYpKSBmb3JtKSAoc2V0cSBjaWYgbmlsKSkKLSAgICAgICAgICAgICAgICAg KCduaWwgbmlsKQotICAgICAgICAgICAgICAgICA7OyBUaGUgaW50ZXJhY3RpdmUgZm9ybSBuZWVk cyBzcGVjaWFsIHRyZWF0bWVudCwgc28gdGhlIGZvcm0KLSAgICAgICAgICAgICAgICAgOzsgaW5z aWRlIHRoZSBgaW50ZXJhY3RpdmUnIHdvbid0IGJlIHVzZWQgYW55IGZ1cnRoZXIuCi0gICAgICAg ICAgICAgICAgIChfIChzZXRmIChjYWRyIChjYXIgYmYpKSBuaWwpKSkpCi0gICAgICAgICAgICAo Y2YgKGNjb252LS1jb252ZXJ0LWZ1bmN0aW9uIGFyZ3MgYm9keSBlbnYgZm9ybSBkb2NzdHJpbmcp KSkKKyAgICAgICAgICAgIChjZiBuaWwpKQorICAgICAgIDs7IFRPRE86IEJlY2F1c2Ugd2UgbmVl ZCB0byBub24tZGVzdHJ1Y3RpdmVseSBtb2RpZnkgYm9keSwgdGhpcyBjb2RlCisgICAgICAgOzsg aXMgcGFydGljdWxhcmx5IHVnbHkuICBUaGlzIHNob3VsZCBpZGVhbGx5IGJlIG1vdmVkIHRvCisg ICAgICAgOzsgY2NvbnYtLWNvbnZlcnQtZnVuY3Rpb24uCisgICAgICAgKHBjYXNlIGNpZgorICAg ICAgICAgKGAjJyhsYW1iZGEgKCkgLGZvcm0pCisgICAgICAgICAgKHBjYXNlLWxldCAoKGAoKCxm MSAuICgsXyAuICxmMikpIC4gLGYzKSBiZikpCisgICAgICAgICAgICAoc2V0cSBiZiBgKCgsZjEg LiAoLGZvcm0gLiAsZjIpKSAuICxmMykpKQorICAgICAgICAgIChzZXRxIGNpZiBuaWwpKQorICAg ICAgICAgKCduaWwgKHNldHEgYmYgbmlsKSkKKyAgICAgICAgIDs7IFRoZSBpbnRlcmFjdGl2ZSBm b3JtIG5lZWRzIHNwZWNpYWwgdHJlYXRtZW50LCBzbyB0aGUgZm9ybQorICAgICAgICAgOzsgaW5z aWRlIHRoZSBgaW50ZXJhY3RpdmUnIHdvbid0IGJlIHVzZWQgYW55IGZ1cnRoZXIuCisgICAgICAg ICAoXyAocGNhc2UtbGV0ICgoYCgoLGYxIC4gKCxfIC4gLGYyKSkgLiAsZjMpIGJmKSkKKyAgICAg ICAgICAgICAgKHNldHEgYmYgYCgoLGYxIC4gKG5pbCAuICxmMikpIC4gLGYzKSkpKSkKKyAgICAg ICAod2hlbiBiZgorICAgICAgICAgOzsgSWYgd2UgbW9kaWZpZWQgYmYsIHJlLWJ1aWxkIGJvZHkg YW5kIGZvcm0gYXMKKyAgICAgICAgIDs7IGNvcGllcyB3aXRoIHRoZSBtb2RpZmllZCBiaXRzLgor ICAgICAgICAgKHNldHEgYm9keSAoaWYgKHN0cmluZ3AgKGNhciBib2R5KSkKKyAgICAgICAgICAg ICAgICAgICAgICAgIChjb25zIChjYXIgYm9keSkgYmYpCisgICAgICAgICAgICAgICAgICAgICAg YmYpCisgICAgICAgICAgICAgICBmb3JtIGAoZnVuY3Rpb24gKGxhbWJkYSAsYXJncyAuICxib2R5 KSAuICxyZXN0KSkKKyAgICAgICAgIDs7IEFsc28sIHJlbW92ZSB0aGUgY3VycmVudCBvbGQgZW50 cnkgb24gdGhlIGFsaXN0LCByZXBsYWNpbmcKKyAgICAgICAgIDs7IGl0IHdpdGggdGhlIG5ldyBv bmUuCisgICAgICAgICAobGV0ICgoZW50cnkgKHBvcCBjY29udi1mcmVldmFycy1hbGlzdCkpKQor ICAgICAgICAgICAocHVzaCAoY29ucyBib2R5IChjZHIgZW50cnkpKSBjY29udi1mcmVldmFycy1h bGlzdCkpKQorICAgICAgIChzZXRxIGNmIChjY29udi0tY29udmVydC1mdW5jdGlvbiBhcmdzIGJv ZHkgZW52IGZvcm0gZG9jc3RyaW5nKSkKKwogICAgICAgIChpZiAobm90IGNpZikKICAgICAgICAg ICAgOzsgTm9ybWFsIGNhc2UsIHRoZSBpbnRlcmFjdGl2ZSBmb3JtIG5lZWRzIG5vIHNwZWNpYWwg dHJlYXRtZW50LgogICAgICAgICAgICBjZgo= --=-X/9QhZyWMN+vY9a98Cui-- --=-PcWen83cR674IjG08Lw4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEftHUjFE8oCS+Onhf4/soy2q1lZgFAmPaF8cACgkQ4/soy2q1 lZg0RAf+M9fUaxCfvgVqm8/uDaFoYXr81zXufqrEmnZxYnIoYHy7bd79ksZqhTVn /6MC+ayDpMKd2iMvHYEWL77STnPfjyIg57d/Vaa0/Pq2oGBXCZL+/fwotb0ta9zI mlGEuj/Wv2DVbqEHTwH6uP5V/sgmv5FQbdXsbyfzVgD3xEDSkzQ2Y67vf8mm/r9m bkIwlqagmsNTF4BED5zQTGyZiDqGoXjLAr/8tidHHEE5YXHtl2O5a29mbCJWgizi YlJXRylX9DsokwsIMbqR2bju4xvs2DTkt1lTS2fsWKafR+FOej4keT8qQV2CJGfE T02u71IJtMLLD2NbRuWiRV+F8NA/Pg== =PALd -----END PGP SIGNATURE----- --=-PcWen83cR674IjG08Lw4--