From debbugs-submit-bounces@debbugs.gnu.org Mon May 17 07:34:56 2021 Received: (at submit) by debbugs.gnu.org; 17 May 2021 11:34:56 +0000 Received: from localhost ([127.0.0.1]:51990 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1libWR-0007D6-PZ for submit@debbugs.gnu.org; Mon, 17 May 2021 07:34:56 -0400 Received: from lists.gnu.org ([209.51.188.17]:60870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1libWO-0007Cw-4r for submit@debbugs.gnu.org; Mon, 17 May 2021 07:34:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1libWN-0005bM-4t for bug-gnu-emacs@gnu.org; Mon, 17 May 2021 07:34:51 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:46862) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1libWH-00063Y-EM for bug-gnu-emacs@gnu.org; Mon, 17 May 2021 07:34:50 -0400 Received: by mail-wr1-x42f.google.com with SMTP id y14so3924165wrm.13 for ; Mon, 17 May 2021 04:34:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=mP11UimAg+TgEUtXFZUQITq6uWmypgZFUHXnELW7648=; b=qxVThbeP1tdVt/81ly61SAqdOMD8aEjFZPp63ZxlFtkEkHIHHagDOaF8H6rViOYNYT SoMr609+Fsrj7Qyb437mz+vYj4o/uEVX8Npd43IfJNaZ4sKRxLH2cuInE4kZGzupa2dc BPwGc1Mj1BJFh/lUpVvWmzrYbJq9Z4FJ69T1G2NKBC9Bpr6jatz/wG/b7j5jA+3PzNAT 7snPdkwzkM530/TurHvSqA94RsIBq9Z4Sq25uGTROH0bxvlYlGejLGBHLqiUDp6XaC0V PNvFBH0+gehUPtiqkh91HKRGeSk4m0fp7fswzb92uDCLrKwqG2iBExMRZVE9t3j6bvR7 Rgfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=mP11UimAg+TgEUtXFZUQITq6uWmypgZFUHXnELW7648=; b=Vz/rq/vOMGMYdC43sNXikmFrXXsFrpWtD7LG5onRELhfID6l1fFiJg45eF6rR2eXS4 fymAHfYNSX4+hd7mZNpgdyIXxjazlZVaWcTOXEc6JkhkV4F3B4TAUpk7cAHsyIKoZqSF gmR7X3FsUIqAW+iDeKfCAWp/vi5h475H9hHqA/kUmwXewRT8+i2frA9os6NHqe4F7+pT W1wVfi1BsrIIPLDUaSyIzQNJ3Kcv18T33Sh0ELThx4C0I67Wsn6NTQZrVMrsfPLjHUma jelTV5aVIAMlc+SmZdm01qMKqjTALC00EKf9dJpMMlMjojl62DTwD6nDhH3w6zV69hy0 9GHQ== X-Gm-Message-State: AOAM531mXiJmR7nPA1uYnFkbB/ppZ3IhnH7wyrYeLgBNAQzpd8oa5t9a QMgk/iq/ElczoPebKbsc6LU1pS8NIyKnsQ== X-Google-Smtp-Source: ABdhPJwFAn2xZUO+keF64fP4f4bNxeoZA1+tSD/tuEY6OWvoKKePRqlFq/26FkCFpE+Iua3pUoOZsA== X-Received: by 2002:adf:d843:: with SMTP id k3mr12979140wrl.138.1621251283756; Mon, 17 May 2021 04:34:43 -0700 (PDT) Received: from phst ([46.128.198.100]) by smtp.gmail.com with ESMTPSA id q62sm5988035wma.42.2021.05.17.04.34.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 04:34:43 -0700 (PDT) From: Philipp Stephani To: bug-gnu-emacs@gnu.org Subject: 28.0.50; Seemingly incorrect codegen with multiple string-matching pcase patterns Date: Mon, 17 May 2021 13:34:42 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=p.stephani2@gmail.com; helo=mail-wr1-x42f.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, 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-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Consider the following pcase form: (require 'rx) (pcase string ((rx bos (let prefix ?@) (* (not (any ?: ?/))) eos) (list 1 prefix)) ((rx bos (let prefix (* (not (any ?:))) "/...:" eos)) (list 2 prefix))) The two branches should be disjoint; e.g. "@foo//...:" should match only the second, not the first. Emacs 27.2 agrees and generates the following code: (cond ((string-match "\\`\\(?1:@\\)[^/:]*\\'" string) (let* ((#1=3D#:x457 (match-string 1 string))) (let ((prefix #1#)) (list 1 prefix)))) ((string-match "\\`\\(?1:[^:]*/\\.\\.\\.:\\'\\)" string) (let* ((#2=3D#:x458 (match-string 1 string))) (let ((prefix #2#)) (list 2 prefix)))) (t nil)) However, Emacs master prints the following warning: Warning: pcase pattern (rx bos (let prefix (* (not (any 58))) "/...:" e= os)) shadowed by previous pcase pattern and generates this code: (if (stringp string) (let* ((#1=3D#:x42 (funcall #'(lambda (s) (and (string-match "\\`\\(?1:@\\)[^/:]*\\'" s) (match-string 1 s))) string))) (let ((prefix #1#)) (list 1 prefix)))) which looks clearly wrong (and also needlessly complex). In GNU Emacs 28.0.50 (build 104, x86_64-pc-linux-gnu, GTK+ Version 3.24.24,= cairo version 1.16.0) of 2021-05-17 Repository revision: 42950e9e4647c28f56c72cc27ef96edbafcbe5cd Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12010000 System Description: Debian GNU/Linux rodete Configured using: 'configure --enable-gcc-warnings=3Dwarn-only --enable-gtk-deprecation-warnings --without-pop --with-mailutils --enable-checking=3Dall --enable-check-lisp-object-type --with-modules 'CFLAGS=3D-O0 -ggdb3'' Configured features: CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON LIBSELINUX LIBSYSTEMD MODULES NOTIFY INOTIFY PDUMPER PNG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB Important settings: value of $LC_TIME: en_DK.utf8 value of $LANG: en_US.utf8 value of $XMODIFIERS: @im=3Dibus locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc dired dired-loaddefs rfc822 mml mml-sec epa epg epg-config gnus-util rmail rmail-loaddefs time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils phst skeleton derived edmacro kmacro pcase ffap thingatpt url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json map url-vars mailcap rx gnutls puny dbus xml subr-x seq byte-opt gv bytecomp byte-compile cconv compile text-property-search comint ansi-color ring cl-loaddefs cl-lib iso-transl tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 69432 7725) (symbols 48 8422 1) (strings 32 24391 1618) (string-bytes 1 789459) (vectors 16 15075) (vector-slots 8 195624 5994) (floats 8 26 32) (intervals 56 223 0) (buffers 992 11)) --=20 Google Germany GmbH Erika-Mann-Stra=C3=9Fe 33 80636 M=C3=BCnchen Gesch=C3=A4ftsf=C3=BChrer: Paul Manicle, Halimah DeLaine Prado Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Diese E-Mail ist vertraulich. Falls Sie diese f=C3=A4lschlicherweise erhal= ten haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, l=C3=B6sche= n Sie alle Kopien und Anh=C3=A4nge davon und lassen Sie mich bitte wissen, dass d= ie E-Mail an die falsche Person gesendet wurde. This e-mail is confidential. If you received this communication by mistake, please don=E2=80=99t forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person. From debbugs-submit-bounces@debbugs.gnu.org Tue May 18 06:44:38 2021 Received: (at 48477) by debbugs.gnu.org; 18 May 2021 10:44:38 +0000 Received: from localhost ([127.0.0.1]:54525 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lixDK-0007Jx-C2 for submit@debbugs.gnu.org; Tue, 18 May 2021 06:44:38 -0400 Received: from mail171c50.megamailservers.eu ([91.136.10.181]:54572 helo=mail92c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lixDH-0007Jm-Ek for 48477@debbugs.gnu.org; Tue, 18 May 2021 06:44:36 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1621334673; bh=xeJtkOzsOZ/ak8hsXN4VGNgw01Is4b8rk3fUB5D+j50=; h=From:Subject:Date:Cc:To:From; b=Of16fnIQg6b+IGQPHL/kADY7QRAJW0xH1rJE0zXavzD8V1C/cVWts5opB5XWyIw2Y /mhrv22q7fXIHRpxVpMuTv9nANMKOG+qUKXIC6PQW8/NuYCAmwKtbGzErYh0LhT8mL 0gRHS70Fotp0yxzpJqV4G5m8CZpTV+/hBICZfIvs= Feedback-ID: mattiase@acm.or Received: from stanniol.lan (c-b952e353.032-75-73746f71.bbcust.telenor.se [83.227.82.185]) (authenticated bits=0) by mail92c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 14IAiUoM019226; Tue, 18 May 2021 10:44:32 +0000 From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Content-Type: multipart/mixed; boundary="Apple-Mail=_695038D0-78A7-4415-AE7F-F736A9109526" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.20\)) Subject: bug#48477: 28.0.50; Seemingly incorrect codegen with multiple string-matching pcase patterns Message-Id: Date: Tue, 18 May 2021 12:44:30 +0200 To: Philipp X-Mailer: Apple Mail (2.3445.104.20) X-CTCH-RefID: str=0001.0A742F1F.60A39A91.003C, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=UJ+j4xXy c=1 sm=1 tr=0 a=von4qPfY+hyqc0zmWf0tYQ==:117 a=von4qPfY+hyqc0zmWf0tYQ==:17 a=M51BFTxLslgA:10 a=BU4cgGofng8_JXU45KkA:9 a=CjuIK1q_8ugA:10 a=CjFneMiAhERw_nCuohkA:9 a=B2y7HmGcmWMA:10 X-Origin-Country: SE X-Spam-Score: 1.4 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Serves me right for trying to be clever! Very sorry about that. Matches would always succeed because the outcome was erroneously transformed into a match against a plain pcase variable which never fails. For example, the pattern Content analysis details: (1.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.4 KHOP_HELO_FCRDNS Relay HELO differs from its IP's reverse DNS X-Debbugs-Envelope-To: 48477 Cc: 48477@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --Apple-Mail=_695038D0-78A7-4415-AE7F-F736A9109526 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Serves me right for trying to be clever! Very sorry about that. Matches would always succeed because the outcome was erroneously = transformed into a match against a plain pcase variable which never = fails. For example, the pattern (rx (let x "a")) would expand to =20 (and (pred stringp) (app (lambda (s) (and (string-match (rx (group-n 1 "a")) s) (match-string 1 s))) x)) which cannot fail (as long as the input is a string). Patterns with two = or more named submatches are not affected because of the structural = match used, and zero submatches were treated specially anyway. Please try the attached patch. It encodes non-matches as the number 0 = (any non-nil non-string value would have done; 0 is cheap to create and = test). The above pattern now expands to (and (pred stringp) (app (lambda (s) (if (string-match (rx (group-n 1 "a")) s) (match-string 1 s) 0)) (and x (pred (not numberp))))) --Apple-Mail=_695038D0-78A7-4415-AE7F-F736A9109526 Content-Disposition: attachment; filename=0001-Fix-pcase-rx-patterns-with-a-single-named-submatch-b.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Fix-pcase-rx-patterns-with-a-single-named-submatch-b.patch" Content-Transfer-Encoding: quoted-printable =46rom=20be9db2b94d31a0afe3f93302558b3a78605244c7=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20= =0ADate:=20Tue,=2018=20May=202021=2012:03:11=20+0200=0A= Subject:=20[PATCH]=20Fix=20pcase=20'rx'=20patterns=20with=20a=20single=20= named=20submatch=0A=20(bug#48477)=0A=0Apcase=20'rx'=20patterns=20with=20= a=20single=20named=20submatch,=20like=0A=0A=20=20(rx=20(let=20x=20"a"))=0A= =0Awould=20always=20succeed=20because=20of=20an=20over-optimistic=20= transformation.=0APatterns=20with=200=20or=20more=20than=201=20named=20= submatches=20were=20not=20affected.=0A=0AReported=20by=20Philipp=20= Stephani.=0A=0A*=20lisp/emacs-lisp/rx.el=20(rx--pcase-macroexpander):=0A= Special=20case=20for=20a=20single=20named=20submatch.=0A*=20= test/lisp/emacs-lisp/rx-tests.el=20(rx-pcase):=20Add=20tests.=0A---=0A=20= lisp/emacs-lisp/rx.el=20=20=20=20=20=20=20=20=20=20=20=20|=2021=20= ++++++++++++++++-----=0A=20test/lisp/emacs-lisp/rx-tests.el=20|=2014=20= ++++++++++++++=0A=202=20files=20changed,=2030=20insertions(+),=205=20= deletions(-)=0A=0Adiff=20--git=20a/lisp/emacs-lisp/rx.el=20= b/lisp/emacs-lisp/rx.el=0Aindex=201e3eb9c12b..43bd84d999=20100644=0A---=20= a/lisp/emacs-lisp/rx.el=0A+++=20b/lisp/emacs-lisp/rx.el=0A@@=20-1445,12=20= +1445,23=20@@=20rx=0A=20=20=20=20=20=20=20=20=20=20(regexp=20= (rx--to-expr=20(rx--pcase-transform=20(cons=20'seq=20regexps))))=0A=20=20= =20=20=20=20=20=20=20=20(nvars=20(length=20rx--pcase-vars)))=0A=20=20=20=20= =20`(and=20(pred=20stringp)=0A-=20=20=20=20=20=20=20=20=20=20,(if=20= (zerop=20nvars)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20No=20= variables=20bound:=20a=20single=20predicate=20suffices.=0A-=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20`(pred=20(string-match=20,regexp))=0A+=20=20= =20=20=20=20=20=20=20=20,(pcase=20nvars=0A+=20=20=20=20=20=20=20=20=20=20= =20=20(0=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20No=20variables=20= bound:=20a=20single=20predicate=20suffices.=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20`(pred=20(string-match=20,regexp)))=0A+=20=20=20=20=20=20=20=20= =20=20=20=20(1=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20Create=20a=20= match=20value=20that=20on=20a=20successful=20regexp=20match=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20;;=20is=20the=20submatch=20value,=200=20on=20= failure.=20=20We=20can't=20use=20nil=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20;;=20for=20failure=20because=20it=20is=20a=20valid=20submatch=20= value.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20`(app=20(lambda=20(s)=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(if=20= (string-match=20,regexp=20s)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(match-string=201=20s)=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=200))=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(and=20,(car=20= rx--pcase-vars)=20(pred=20(not=20numberp)))))=0A+=20=20=20=20=20=20=20=20= =20=20=20=20(_=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20Pack=20= the=20submatches=20into=20a=20dotted=20list=20which=20is=20then=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20;;=20immediately=20destructured=20into=20= individual=20variables=20again.=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20= ;;=20This=20is=20of=20course=20slightly=20inefficient=20when=20NVARS=20>=20= 1.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20This=20is=20of=20= course=20slightly=20inefficient.=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20;;=20A=20dotted=20list=20is=20used=20to=20reduce=20the=20number=20of=20= conses=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20to=20create=20= and=20take=20apart.=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20`(app=20= (lambda=20(s)=0A@@=20-1463,7=20+1474,7=20@@=20rx=0A=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (rx--reduce-right=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20#'cons=0A=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(mapcar=20(lambda=20= (name)=20(list=20'\,=20name))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(reverse=20= rx--pcase-vars)))))))))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(reverse=20= rx--pcase-vars))))))))))=0A=20=0A=20;;=20Obsolete=20internal=20symbol,=20= used=20in=20old=20versions=20of=20the=20`flycheck'=20package.=0A=20= (define-obsolete-function-alias=20'rx-submatch-n=20'rx-to-string=20= "27.1")=0Adiff=20--git=20a/test/lisp/emacs-lisp/rx-tests.el=20= b/test/lisp/emacs-lisp/rx-tests.el=0Aindex=202dd1bca22d..4828df0de9=20= 100644=0A---=20a/test/lisp/emacs-lisp/rx-tests.el=0A+++=20= b/test/lisp/emacs-lisp/rx-tests.el=0A@@=20-166,6=20+166,20=20@@=20= rx-pcase=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(backref=201))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(list=20u=20v)))=0A=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20'("1"=20"3")))=0A+=20=20(should=20(equal=20(pcase=20= "bz"=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20((rx=20= "a"=20(let=20x=20nonl))=20(list=201=20x))=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(_=20'no))=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20'no))=0A+=20=20(should=20(equal=20(pcase=20"az"=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20((rx=20"a"=20(let=20x=20= nonl))=20(list=201=20x))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20((rx=20"b"=20(let=20x=20nonl))=20(list=202=20x))=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(_=20'no))=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20'(1=20"z")))=0A+=20=20(should=20= (equal=20(pcase=20"bz"=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20((rx=20"a"=20(let=20x=20nonl))=20(list=201=20x))=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20((rx=20"b"=20(let=20x=20= nonl))=20(list=202=20x))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(_=20'no))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20'(2=20"z")))=0A=20=20=20(let=20((k=20"blue"))=0A=20=20=20=20=20= (should=20(equal=20(pcase=20""=0A=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20((rx=20"<"=20(literal=20k)=20">")=20'ok))=0A= --=20=0A2.21.1=20(Apple=20Git-122.3)=0A=0A= --Apple-Mail=_695038D0-78A7-4415-AE7F-F736A9109526-- From debbugs-submit-bounces@debbugs.gnu.org Tue May 18 07:09:32 2021 Received: (at 48477) by debbugs.gnu.org; 18 May 2021 11:09:32 +0000 Received: from localhost ([127.0.0.1]:54542 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lixbQ-00087D-Fa for submit@debbugs.gnu.org; Tue, 18 May 2021 07:09:32 -0400 Received: from mail-ot1-f49.google.com ([209.85.210.49]:43863) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lixbN-00086x-UT for 48477@debbugs.gnu.org; Tue, 18 May 2021 07:09:30 -0400 Received: by mail-ot1-f49.google.com with SMTP id u19-20020a0568302493b02902d61b0d29adso8269736ots.10 for <48477@debbugs.gnu.org>; Tue, 18 May 2021 04:09:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Kcu2SuF2eR1NwRIkJRhB2d3UHZhCiesJ5UdnTCCQP50=; b=gGqVX86G2gYRBQvUpp2AKkmckOe2vH2bYHipzYJLhbnM0UUSJFJ5hb5Q3i6HeFarH+ 7XWEOL++QhgqJkLlt0QBrs8ByigQfjz8335Fh7Aww5KltxTmRa+Ytf67YRYNqfSPBvBY BjdCj9qKX17YdwLSjiDPEQhhrWqTxibPGV2E3K0RyPoVdKABgirayqs+q5QFkyMQillm wgjh4bfyrOdWrY8K3PYg3UOmm2bLFSUX7gpZDxEyfTbXTNocICJ8QP4AKho08Dhkry+3 jD9BQHdy+lk4tLJPhPtZxArQXUPa3IHT6ZwOmvjiCsCDrQ2zCJsn6xLimtvhS6Kc+PA6 hysA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Kcu2SuF2eR1NwRIkJRhB2d3UHZhCiesJ5UdnTCCQP50=; b=a7dZ9LJwVE4GAof3eg49ebd+7aUbeKgVcXIv3TIW/Wnga9HPzop+AvPlzJ/acBqqdb pjvYvCXBOnvlVjrBTStR3ebgwHuvzpvpmzKJNaf0B45nMlKhs1Tg2MT0dKD51/wKyAUq qWXcZ49Fpw5lw7XSAmkD2GmskmPhAcEkHE1PCQgQWG4iIbihtgWDPL9WOToyYaU+vTAn D8TnebuoHSLeF4Y+xtD7WW9X8pX/Klm7sdSLe5lhaj8/N9275PcR9F27jZUDMKWGGhas gIrB6tB3ZbLYXhnIqZZblEuKGvnaYYWnCfc0byeQ9LQuA1uQsv39ymdUgTSgqM0jm3i2 vhnw== X-Gm-Message-State: AOAM533n6XJTjWAvQLhuT31Slm++8Ug2PGpNJW5ZXJfpOLvN6iLAk+gG Ulpeg/xbWMsqtoSsGZwtoGHMiK/jt3r1mcKf/2M= X-Google-Smtp-Source: ABdhPJyxnOyL4hXtaNxc0XS5fMZnwVS+BxhFAajcpiiWdfdC24u79R3CChwoOc9IrdEBJauprRGjFKW3tIIGNSBu+F4= X-Received: by 2002:a9d:d0e:: with SMTP id 14mr3853659oti.12.1621336164251; Tue, 18 May 2021 04:09:24 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Philipp Stephani Date: Tue, 18 May 2021 13:09:13 +0200 Message-ID: Subject: Re: bug#48477: 28.0.50; Seemingly incorrect codegen with multiple string-matching pcase patterns To: =?UTF-8?Q?Mattias_Engdeg=C3=A5rd?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 48477 Cc: 48477@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Am Di., 18. Mai 2021 um 12:44 Uhr schrieb Mattias Engdeg=C3=A5rd : > Please try the attached patch. Thanks, that fixes my use case. From debbugs-submit-bounces@debbugs.gnu.org Tue May 18 07:12:29 2021 Received: (at 48477-done) by debbugs.gnu.org; 18 May 2021 11:12:29 +0000 Received: from localhost ([127.0.0.1]:54547 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lixeG-0008Bb-Sz for submit@debbugs.gnu.org; Tue, 18 May 2021 07:12:29 -0400 Received: from mail230c50.megamailservers.eu ([91.136.10.240]:39566 helo=mail37c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lixeD-0008BP-EF for 48477-done@debbugs.gnu.org; Tue, 18 May 2021 07:12:27 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1621336343; bh=iVM7GeLHHzE/fd+jVgOX0HQq06bz9BABvLfg4FbzKQ0=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=UU/Reocrc79yBFMRjp5IoI15ZQLytu8YEuzH2ZBSetobBmOwREiMZuV5sstFYx74I mNXwCgDRAxtDrXqiAjF2igzTGKbtu/3dCVJKfQrNaih8bOkZFELry2S7w1P3Uxj9po GhoVQHM608hLlEREGjJGBwcPPt+j8BKfxXb8MOyo= Feedback-ID: mattiase@acm.or Received: from stanniol.lan (c-b952e353.032-75-73746f71.bbcust.telenor.se [83.227.82.185]) (authenticated bits=0) by mail37c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 14IBCKGQ015142; Tue, 18 May 2021 11:12:22 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.20\)) Subject: Re: bug#48477: 28.0.50; Seemingly incorrect codegen with multiple string-matching pcase patterns From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: Date: Tue, 18 May 2021 13:12:20 +0200 Content-Transfer-Encoding: 7bit Message-Id: <74AFED6D-B67A-4EC7-BF64-07107AB69449@acm.org> References: To: Philipp Stephani X-Mailer: Apple Mail (2.3445.104.20) X-CTCH-RefID: str=0001.0A742F15.60A3A117.001B, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=Grk8BX9C c=1 sm=1 tr=0 a=von4qPfY+hyqc0zmWf0tYQ==:117 a=von4qPfY+hyqc0zmWf0tYQ==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=pGLkceISAAAA:8 a=-I9IPhScTZh-qpwEUjMA:9 a=CjuIK1q_8ugA:10 a=AFFavMMt4cAA:10 X-Origin-Country: SE X-Spam-Score: 1.4 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 18 maj 2021 kl. 13.09 skrev Philipp Stephani : > Thanks, that fixes my use case. Thank you for testing! Pushed and closed. Content analysis details: (1.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.4 KHOP_HELO_FCRDNS Relay HELO differs from its IP's reverse DNS X-Debbugs-Envelope-To: 48477-done Cc: Stefan Monnier , 48477-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) 18 maj 2021 kl. 13.09 skrev Philipp Stephani : > Thanks, that fixes my use case. Thank you for testing! Pushed and closed. From unknown Fri Sep 05 11:51:10 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 15 Jun 2021 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator