+2005-08-01 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * dwarf2-frame.c (read_signed_leb128): Handle values that do not
+ fit in 32 bits.
+ * dwarf2read.c (read_signed_leb128): Likewise.
+
2005-07-31 Daniel Jacobowitz <dan@codesourcery.com>
From Josef Ezra <jezra@emc.com>:
}
while (byte & 0x80);
- if ((shift < 32) && (byte & 0x40))
- result |= -(1 << shift);
+ if (shift < 8 * sizeof (result) && (byte & 0x40))
+ result |= -(((LONGEST)1) << shift);
*bytes_read_ptr = num_read;
read_signed_leb128 (bfd *abfd, char *buf, unsigned int *bytes_read_ptr)
{
long result;
- int i, shift, size, num_read;
+ int i, shift, num_read;
unsigned char byte;
result = 0;
shift = 0;
- size = 32;
num_read = 0;
i = 0;
while (1)
break;
}
}
- if ((shift < size) && (byte & 0x40))
- {
- result |= -(1 << shift);
- }
+ if ((shift < 8 * sizeof (result)) && (byte & 0x40))
+ result |= -(((long)1) << shift);
*bytes_read_ptr = num_read;
return result;
}