summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2022-01-23 15:16:07 -0700
committerKarl Williamson <khw@cpan.org>2022-01-23 15:20:31 -0700
commitfc23c914f8de7cb85f58830142e0164864d4601c (patch)
tree4f35625c42b2e0a54a6008144780e7ac3d4fe1ee
parent61538b15f8baf714e68af9f1fb3fa085388de4a7 (diff)
downloadperl-fc23c914f8de7cb85f58830142e0164864d4601c.tar.gz
regcomp.c: Fix undefined behavior
Spotted by ASAN. To shift 31 bits in a 32 bit word, it has to be unsigned.
-rw-r--r--regcomp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/regcomp.c b/regcomp.c
index 9fe867b2fa..b2c2dffa66 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -21145,8 +21145,8 @@ S_regdump_extflags(pTHX_ const char *lead, const U32 flags)
ASSUME(REG_EXTFLAGS_NAME_SIZE <= sizeof(flags)*8);
for (bit=0; bit<REG_EXTFLAGS_NAME_SIZE; bit++) {
- if (flags & (1<<bit)) {
- if ((1<<bit) & RXf_PMf_CHARSET) { /* Output separately, below */
+ if (flags & (1U<<bit)) {
+ if ((1U<<bit) & RXf_PMf_CHARSET) { /* Output separately, below */
continue;
}
if (!set++ && lead)