* dwarf2expr.c (read_sleb128): Fix signed extension overflowing host
	`int'.

gdb/testsuite/
	* gdb.dwarf2/dw2-const.S (Pointer size): Change from 4 to 8.
	(DW_AT_high_pc, DW_AT_low_pc): Remove them.
	(val8, .Ltype_const8, .Ltype_int8, DW_TAG_variable): New.
	* gdb.dwarf2/dw2-const.exp (print/x val8): New test.
This commit is contained in:
Jan Kratochvil 2011-07-11 13:40:24 +00:00
parent 713389e024
commit 04ad99e60b
5 changed files with 54 additions and 14 deletions

View file

@ -418,7 +418,7 @@ read_sleb128 (const gdb_byte *buf, const gdb_byte *buf_end, LONGEST * r)
break;
}
if (shift < (sizeof (*r) * 8) && (byte & 0x40) != 0)
result |= -(1 << shift);
result |= -(((LONGEST) 1) << shift);
*r = result;
return buf;