diff options
author | Yves Orton <demerphq@gmail.com> | 2016-03-14 23:30:02 +0100 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2016-03-15 00:31:59 +0100 |
commit | ce12e2548182b5bf6788188c520311eef0eca0ca (patch) | |
tree | d54b37ab4e01b03128d27930121451b710d935c6 /regexp.h | |
parent | 595de7616f5ea9813e28dc502de1c480ef2a5a97 (diff) | |
download | perl-ce12e2548182b5bf6788188c520311eef0eca0ca.tar.gz |
fix "bad match" issue reported in perl #127705
In 24be310237a0f8f19cfdb71de1b068b4ce9572a0 I reworked how
we stored the close_paren info in the regexp match state
structure. Unfortunately I missed a subtle aspect of the
logic which meant that in certain cases we were relying
on close_paren being true to avoid comparing it against
a false ARG value for things like CURLYX, which meant that
sometimes we would exit an stack frame prematurely. This
patch fixes that logic and makes it more clear (via macros)
what is going on.
Diffstat (limited to 'regexp.h')
-rw-r--r-- | regexp.h | 13 |
1 files changed, 1 insertions, 12 deletions
@@ -840,18 +840,7 @@ typedef struct regmatch_state { } u; } regmatch_state; -#define EVAL_CLOSE_PAREN_IS(st,expr) \ -(\ - ( ( st ) ) && \ - ( ( st )->u.eval.close_paren ) && \ - ( ( ( st )->u.eval.close_paren - 1 ) == ( expr ) ) \ -) - -#define EVAL_CLOSE_PAREN_SET(st,expr) \ - (st)->u.eval.close_paren = (expr) + 1 - -#define EVAL_CLOSE_PAREN_CLEAR(st) \ - (st)->u.eval.close_paren = 0 + /* how many regmatch_state structs to allocate as a single slab. * We do it in 4K blocks for efficiency. The "3" is 2 for the next/prev |