From 4eeecae9b789443c40ecbee02022bebaadf2a28f Mon Sep 17 00:00:00 2001 From: Florian Krohm Date: Fri, 19 Jun 2015 12:01:07 +0000 Subject: [PATCH] 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 --- coregrind/m_aspacemgr/aspacemgr-segnames.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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. */ -- 2.47.2