diff options
author | Karl Williamson <khw@cpan.org> | 2018-11-27 10:51:46 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2018-12-26 12:50:37 -0700 |
commit | 72823d10f21676ddf0ccde075ac280a9a78ee006 (patch) | |
tree | 00d5c37ee01d9e196ea60f8485d5d1f6e8c8d837 /regcomp.c | |
parent | 3e6e81faa0caa5599d0862f85f1f3c1ef2e49030 (diff) | |
download | perl-72823d10f21676ddf0ccde075ac280a9a78ee006.tar.gz |
regcomp.c: Don't zap larger scope variables
It doesn't matter currently, but it's best to declare more limited scope
variables for doing limited scope work, rather than using the more
global variable, which someday might want to be used later, outside the
block that zapped it, and would lead to a surprise.
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -18476,6 +18476,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth, } if (invlist_highest(cp_list) <= max_permissible) { + UV this_start, this_end; Size_t cp_count = 0; bool first_time = TRUE; unsigned int lowest_cp = 0xFF; @@ -18489,10 +18490,10 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth, /* Go through the bytes and find the bit positions that differ * */ invlist_iterinit(cp_list); - while (invlist_iternext(cp_list, &start, &end)) { - unsigned int i = start; + while (invlist_iternext(cp_list, &this_start, &this_end)) { + unsigned int i = this_start; - cp_count += end - start + 1; + cp_count += this_end - this_start + 1; if (first_time) { if (! UVCHR_IS_INVARIANT(i)) { @@ -18501,7 +18502,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth, } first_time = FALSE; - lowest_cp = start; + lowest_cp = this_start; i++; } @@ -18509,7 +18510,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth, /* Find the bit positions that differ from the lowest code * point in the node. Keep track of all such positions by * OR'ing */ - for (; i <= end; i++) { + for (; i <= this_end; i++) { if (! UVCHR_IS_INVARIANT(i)) { has_variant = TRUE; continue; |