Don't shift negative values.
This commit is contained in:
parent
963949fb1a
commit
664441867e
4
external/gpl3/gdb/dist/gdb/ada-lang.c
vendored
4
external/gpl3/gdb/dist/gdb/ada-lang.c
vendored
@ -2518,7 +2518,7 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr,
|
||||
accumSize += HOST_CHAR_BIT - unusedLS;
|
||||
if (accumSize >= HOST_CHAR_BIT)
|
||||
{
|
||||
unpacked[targ] = accum & ~(~0L << HOST_CHAR_BIT);
|
||||
unpacked[targ] = accum & ~(~0UL << HOST_CHAR_BIT);
|
||||
accumSize -= HOST_CHAR_BIT;
|
||||
accum >>= HOST_CHAR_BIT;
|
||||
ntarg -= 1;
|
||||
@ -2532,7 +2532,7 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr,
|
||||
while (ntarg > 0)
|
||||
{
|
||||
accum |= sign << accumSize;
|
||||
unpacked[targ] = accum & ~(~0L << HOST_CHAR_BIT);
|
||||
unpacked[targ] = accum & ~(~0UL << HOST_CHAR_BIT);
|
||||
accumSize -= HOST_CHAR_BIT;
|
||||
accum >>= HOST_CHAR_BIT;
|
||||
ntarg -= 1;
|
||||
|
Loading…
Reference in New Issue
Block a user