diff options
author | Yves Orton <demerphq@gmail.com> | 2023-01-15 20:31:14 +0100 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2023-03-13 21:26:08 +0800 |
commit | d78630f1ec4da716988da18d97cb6425388e696c (patch) | |
tree | 6ef6a501ea3219d2f493179de78e930b09ce2763 /regcomp.c | |
parent | 17e3e02ad120eabda2bdb6c297a70d53294437ef (diff) | |
download | perl-d78630f1ec4da716988da18d97cb6425388e696c.tar.gz |
regcomp.c - extend REF to hold the paren it needs to regcppush
this way we can avoid pushing every buffer, we only need to push
the nestroot of the ref.
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -2754,7 +2754,7 @@ S_handle_named_backref(pTHX_ RExC_state_t *pRExC_state, SvREFCNT_inc_simple_void_NN(sv_dat); } RExC_sawback = 1; - ret = reg1node(pRExC_state, + ret = reg2node(pRExC_state, ((! FOLD) ? REFN : (ASCII_FOLD_RESTRICTED) @@ -2764,7 +2764,9 @@ S_handle_named_backref(pTHX_ RExC_state_t *pRExC_state, : (LOC) ? REFFLN : REFFN), - num); + num, RExC_nestroot); + if (RExC_nestroot && num >= (U32)RExC_nestroot) + REGNODE_p(ret)->flags = VOLATILE_REF; *flagp |= HASWIDTH; nextchar(pRExC_state); @@ -6028,7 +6030,7 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth) } } RExC_sawback = 1; - ret = reg1node(pRExC_state, + ret = reg2node(pRExC_state, ((! FOLD) ? REF : (ASCII_FOLD_RESTRICTED) @@ -6038,7 +6040,7 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth) : (LOC) ? REFFL : REFF), - num); + num, RExC_nestroot); if (RExC_nestroot && num >= RExC_nestroot) REGNODE_p(ret)->flags = VOLATILE_REF; if (OP(REGNODE_p(ret)) == REFF) { |