summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2018-04-05 08:27:32 -0600
committerKarl Williamson <khw@cpan.org>2018-04-08 11:29:52 -0600
commite5863284b4363af3830b13eb085532a3043c854e (patch)
tree541fbeb0d96129e1005b41ba7c3c7310ccb15b67
parent5baf66636cdcd4a10ac35e5d3aaa57a7fe0b51d8 (diff)
downloadperl-e5863284b4363af3830b13eb085532a3043c854e.tar.gz
PATCH: [perl #133037] new warning in inline.h
This just uses an intermediate variable of the correct type to store the result, and then casts it, as the value is guaranteed to be a number between 0 and 7.
-rw-r--r--inline.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/inline.h b/inline.h
index 8c20e7583a..dc74c2daed 100644
--- a/inline.h
+++ b/inline.h
@@ -641,9 +641,11 @@ S_variant_under_utf8_count(const U8* const s, const U8* const e)
/* Process per-word as long as we have at least a full word left */
do { /* Commit 03c1e4ab1d6ee9062fb3f94b0ba31db6698724b1 contains an
explanation of how this works */
- count += ((((* (PERL_UINTMAX_T *) x) & PERL_VARIANTS_WORD_MASK) >> 7)
+ PERL_UINTMAX_T increment
+ = ((((* (PERL_UINTMAX_T *) x) & PERL_VARIANTS_WORD_MASK) >> 7)
* PERL_COUNT_MULTIPLIER)
>> ((PERL_WORDSIZE - 1) * CHARBITS);
+ count += (Size_t) increment;
x += PERL_WORDSIZE;
} while (x + PERL_WORDSIZE <= e);
}