diff options
author | Karl Williamson <public@khwilliamson.com> | 2011-12-23 19:13:24 -0700 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2012-01-19 11:58:18 -0700 |
commit | d2197104bf4db0983b266cf51c5f9b509a1d606b (patch) | |
tree | 3e8563db581741b2786c5ca426b4e30aaa27d86c /regcomp.c | |
parent | f646642f35679c7859c80485da40c0d146e5550c (diff) | |
download | perl-d2197104bf4db0983b266cf51c5f9b509a1d606b.tar.gz |
regcomp.c: Need to account for delta sizes
When a node can match varying sizes, the delta variable in the optimizer
needs to change to account for that, and it can no longer match a fixed
length string.
This code was adapted from the existing code for the FOLDCHAR node that
has to deal with the same problem.
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -3291,11 +3291,16 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp, if (min < 0) { min = 0; } + delta += abs(min_change); if (flags & SCF_DO_SUBSTR) { data->pos_min += l + min_change; if (data->pos_min < 0) { data->pos_min = 0; } + data->pos_delta += abs(min_change); + if (min_change) { + data->longest = &(data->longest_float); + } } if (flags & SCF_DO_STCLASS_AND) { /* Check whether it is compatible with what we know already! */ |