From: Florian Krohm Date: Fri, 19 Jun 2015 12:01:07 +0000 (+0000) Subject: fbit_mask needs to be unsigned because it sometimes shifts a '1' X-Git-Tag: svn/VALGRIND_3_11_0~290 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4eeecae9b789443c40ecbee02022bebaadf2a28f;p=thirdparty%2Fvalgrind.git fbit_mask needs to be unsigned because it sometimes shifts a '1' into the MSB. Found by ubsan. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15346 --- diff --git a/coregrind/m_aspacemgr/aspacemgr-segnames.c b/coregrind/m_aspacemgr/aspacemgr-segnames.c index 7fcacf4864..73a9472006 100644 --- a/coregrind/m_aspacemgr/aspacemgr-segnames.c +++ b/coregrind/m_aspacemgr/aspacemgr-segnames.c @@ -125,10 +125,12 @@ enum { max_refcount = 0x7fff, // 2 bytes - F-bit max_slotsize = 0xffff, // 2 bytes max_slotindex = 0x7fffffff, // 4 bytes - F-bit - fbit_mask = 0x80, + fbit_mask_value = 0x80, end_of_chain = 0 }; +static const UInt fbit_mask = fbit_mask_value; + /* The old segname implementation allowed for 1000 names on Android and 6000 names on other platforms. Each name was allowed to be 1000 characters long. That was very wasteful. */