summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2012-05-15 21:01:39 +0100
committerDavid Mitchell <davem@iabyn.com>2012-06-13 13:32:53 +0100
commitb3fd53f35858a4ca5c7226ba0fa5a9e864378c38 (patch)
tree760a9af83086fb9a5c529c6a50974adbb1d1bf11 /sv.c
parentb93070ed2e35b0430327cc866a4fcf4042014513 (diff)
downloadperl-b3fd53f35858a4ca5c7226ba0fa5a9e864378c38.tar.gz
eliminate PL_reg_start_tmp, PL_reg_start_tmpl
PL_reg_start_tmp is a global array of temporary parentheses start positions. An element is set when a '(' is first encountered, while when a ')' is seen, the per-regex offs array is updated with the start and end position: the end derived from the position where the ')' was encountered, and the start position derived from PL_reg_start_tmp[n]. This allows us to differentiate between pending and fully-processed captures. Change it so that the tmp start value becomes a third field in the offs array (.start_tmp), along with the existing .start and .end fields. This makes the value now per regex rather than global. Although it uses a bit more memory (the start_tmp values aren't needed after the match has completed), it simplifies the code, and will make it easier to make a (??{}) switch to the new regex without having to dump everything on the save stack.
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/sv.c b/sv.c
index 2f8c8a7294..ec80a168df 100644
--- a/sv.c
+++ b/sv.c
@@ -12708,19 +12708,6 @@ Perl_ss_dup(pTHX_ PerlInterpreter *proto_perl, CLONE_PARAMS* param)
= pv_dup(old_state->re_state_reginput);
new_state->re_state_regeol
= pv_dup(old_state->re_state_regeol);
- /* XXX This just has to be broken. The old save_re_context
- code did SAVEGENERICPV(PL_reg_start_tmp);
- PL_reg_start_tmp is char **.
- Look above to what the dup code does for
- SAVEt_GENERIC_PVREF
- It can never have worked.
- So this is merely a faithful copy of the exiting bug: */
- new_state->re_state_reg_start_tmp
- = (char **) pv_dup((char *)
- old_state->re_state_reg_start_tmp);
- /* I assume that it only ever "worked" because no-one called
- (pseudo)fork while the regexp engine had re-entered itself.
- */
#ifdef PERL_OLD_COPY_ON_WRITE
new_state->re_state_nrs
= sv_dup(old_state->re_state_nrs, param);