Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: 5.4.1 regression: PCRE with bash_rematch
- X-seq: zsh-workers 41540
- From: Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: 5.4.1 regression: PCRE with bash_rematch
- Date: Sun, 13 Aug 2017 17:12:25 -0400
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d201708; h=In-Reply-To:Content-Type:MIME-Version:References :Message-ID:Subject:To:From:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding :Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=AC3pOud39lMKXAYNchupxzj4L3KI3qHk7mvFTDMLxkA=; b=ZNPiAz4dmCETVaTCl8sYe3eBgu UWxb3m1jpRMSEYOoI/MjUAAFWwRIKSFS5/gSryZJt8IiKHFN4+aIxoRRxl1NW19rIRlAgCVT3GszL Is7UxBAOsjOrJlJknKlNIHeueg/Ev/PR9lRyVJZ8KxyU3hM7uWMsyp8yxDHGCY+qK2AX0ePM+y+gU 2UjE6/qM5g1Kk3eHoP/c+w+zLZsI;
- In-reply-to: <20170813204949.GA98824@tower.spodhuis.org>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Openpgp: url=https://www.security.spodhuis.org/PGP/keys/0x4D1E900E14C1CC04.asc
- References: <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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author