From: Phil Pennock <zsh-workers+phil.pennock@spodhuis.org>
To: zsh-workers@zsh.org
Subject: Re: 5.4.1 regression: PCRE with bash_rematch
Date: Sun, 13 Aug 2017 17:12:25 -0400 [thread overview]
Message-ID: <20170813211225.GB98824@tower.spodhuis.org> (raw)
In-Reply-To: <20170813204949.GA98824@tower.spodhuis.org>
On 2017-08-13 at 16:49 -0400, Phil Pennock wrote:
> I'm still trying to track this down, but getting what I have out there
> because in checking just now, I saw that a 5.4.2 might be imminent and I
> think this should block.
Definitely; this is a regression from my NUL fixing and trying to
correctly meta/unmeta all parameters going through. Change 41308 in
commit 825f84c77 exposed a bug introduced in 2011 in commit 2f3c16d40f.
> % /opt/zsh-devel/bin/zsh -f
> osmium% setopt bash_rematch
> osmium% zmodload zsh/pcre
> osmium% [[ "server" -pcre-match ^[^@:/]+$ ]]
186 if (!want_begin_end || nelem) {
187 char **x, **y;
188 int vec_off;
189 y = &captures[capture_start];
190 matches = x = (char **) zalloc(sizeof(char *) * (arrlen(y) + 1));
191 vec_off = 2;
192 do {
193 if (*y)
194 *x++ = metafy(*y, ovec[vec_off+1]-ovec[vec_off], META_DUP);
195 else
196 *x++ = NULL;
197 vec_off += 2;
198 } while (*y++);
199 setaparam(substravar, matches);
200 }
We hit problems in line 194, we're capturing for sub-expressions, but
there are no sub-expressions. We have a regexp with no sub-captures but
through the bash_rematch path we're hitting this which assumes that we
are.
next prev parent reply other threads:[~2017-08-13 21:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-13 20:49 Phil Pennock
2017-08-13 21:12 ` Phil Pennock [this message]
2017-08-13 22:18 ` [PATCH] Repair BASH_REMATCH with no substrings Phil Pennock
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170813211225.GB98824@tower.spodhuis.org \
--to=zsh-workers+phil.pennock@spodhuis.org \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).