diff options
author | Vincent Pit <vince@profvince.com> | 2009-06-25 20:49:49 +0200 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2009-06-26 19:55:34 +0200 |
commit | ee91d26e067c78d37242b4b2ccf3d5d8d3c85b5f (patch) | |
tree | 0441a1261afaca6028f4a91c6a12516d200c3c88 /regcomp.c | |
parent | d00c6acb5649055ca8b949a4bc7e614ee7cf8323 (diff) | |
download | perl-ee91d26e067c78d37242b4b2ccf3d5d8d3c85b5f.tar.gz |
Update RExC_npar and after_freeze correctly after the first branch of a (?| ... )
This fixes RT #59734 : Segfault when using (?|) in regexp.
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -6138,6 +6138,13 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth) /* Pick up the branches, linking them together. */ parse_start = RExC_parse; /* MJD */ br = regbranch(pRExC_state, &flags, 1,depth+1); + + if (freeze_paren) { + if (RExC_npar > after_freeze) + after_freeze = RExC_npar; + RExC_npar = freeze_paren; + } + /* branch_len = (paren != 0); */ if (br == NULL) |