]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Don't try to stuff 16 bit values into 12 bit variables.
authorNicholas Nethercote <njn@valgrind.org>
Wed, 16 Mar 2005 04:09:21 +0000 (04:09 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Wed, 16 Mar 2005 04:09:21 +0000 (04:09 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3374

coregrind/vg_symtab2.c

index 0d6d0a2214125e9d2947960a3c190b4fa5272963..441d91a471e9ef23f742350a5aaa88804252279c 100644 (file)
@@ -723,13 +723,13 @@ void canonicaliseLoctab ( SegInfo* si )
       vg_assert(si->loctab[i].size < 10000);
       if (si->loctab[i].addr + si->loctab[i].size > si->loctab[i+1].addr) {
          /* Do this in signed int32 because the actual .size fields
-            are unsigned 16s. */
+            are only 12 bits. */
          Int new_size = si->loctab[i+1].addr - si->loctab[i].addr;
          if (new_size < 0) {
             si->loctab[i].size = 0;
          } else
-         if (new_size >= 65536) {
-           si->loctab[i].size = 65535;
+         if (new_size > MAX_LOC_SIZE) {
+           si->loctab[i].size = MAX_LOC_SIZE;
          } else {
            si->loctab[i].size = (UShort)new_size;
          }