summaryrefslogtreecommitdiff
path: root/regcomp.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 /regcomp.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 'regcomp.c')
-rw-r--r--regcomp.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/regcomp.c b/regcomp.c
index f2b82a8020..d8dc9af84a 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -13901,8 +13901,6 @@ Perl_save_re_context(pTHX)
Copy(&PL_reg_state, state, 1, struct re_save_state);
- PL_reg_start_tmp = 0;
- PL_reg_start_tmpl = 0;
PL_reg_oldsaved = NULL;
PL_reg_oldsavedlen = 0;
PL_reg_maxiter = 0;