diff options
author | Karl Williamson <khw@cpan.org> | 2022-01-23 15:16:07 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2022-01-23 15:20:31 -0700 |
commit | fc23c914f8de7cb85f58830142e0164864d4601c (patch) | |
tree | 4f35625c42b2e0a54a6008144780e7ac3d4fe1ee | |
parent | 61538b15f8baf714e68af9f1fb3fa085388de4a7 (diff) | |
download | perl-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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) |