]> sourceware.org Git - bzip2.git/commit
Fix undefined behavior in the macros SET_BH, CLEAR_BH, & ISSET_BH
authorPaul Kehrer <paul.l.kehrer@gmail.com>
Sat, 8 Jun 2019 14:06:40 +0000 (10:06 -0400)
committerMark Wielaard <mark@klomp.org>
Mon, 24 Jun 2019 13:24:21 +0000 (15:24 +0200)
commit16f2c753f9959e8d7c7e1fa771b8ccc5821427aa
tree67ba6a528c0b57a51acaeac2e1ef5ae5d8229369
parentf51f164df0e8a2c0e055174b328b4038a040e547
Fix undefined behavior in the macros SET_BH, CLEAR_BH, & ISSET_BH

These macros contain this pattern:
1 << ((Int32_value) & 31

This causes the undefined behavior sanitizers in clang and gcc to
complain because the shift, while ultimately stored to an unsigned
variable, is done as a signed value. Adding a cast to unsigned for
the int32 value resolves this issue.
blocksort.c
This page took 0.021764 seconds and 5 git commands to generate.