]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
fbit_mask needs to be unsigned because it sometimes shifts a '1'
authorFlorian Krohm <florian@eich-krohm.de>
Fri, 19 Jun 2015 12:01:07 +0000 (12:01 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Fri, 19 Jun 2015 12:01:07 +0000 (12:01 +0000)
into the MSB. Found by ubsan.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15346

coregrind/m_aspacemgr/aspacemgr-segnames.c

index 7fcacf4864be28b521b1e9218b2c7afc5eabe2db..73a9472006dea190c2cc12eee5026b1919a60c0e 100644 (file)
@@ -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. */