diff options
author | Hugo van der Sanden <hv@crypt.org> | 2015-02-17 03:27:33 +0000 |
---|---|---|
committer | Hugo van der Sanden <hv@crypt.org> | 2015-02-18 01:40:44 +0000 |
commit | e92b41c6ac6bcd8786b0448c8337c4151e4f9a63 (patch) | |
tree | 6c7b0e81f99418fd7d027fed6e3379a897abc169 /regcomp.c | |
parent | 04ffdf6a81289d4734cb56d4feeba6e14d1c7f8e (diff) | |
download | perl-e92b41c6ac6bcd8786b0448c8337c4151e4f9a63.tar.gz |
[perl #123852] avoid capture side-effects under noncapture flag
//n was implemented by avoiding the primary side-effects of compiling
a capture when the flag was turned on; however some secondary effects
still occurred later in the same function, by using the value of the
'paren' variable - even as far as causing coredumps.
Setting paren to ':' when NOCAPTURE is enabled makes the rest of the
function act just as if it had parsed (?:...) instead of (...).
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -10450,6 +10450,8 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth) Set_Node_Offset(ret, RExC_parse); /* MJD */ is_open = 1; } else { + /* with RXf_PMf_NOCAPTURE treat (...) as (?:...) */ + paren = ':'; ret = NULL; } } |