diff --git a/dwarf.c b/dwarf.c index e5a0cff..c3d5a91 100644 --- a/dwarf.c +++ b/dwarf.c @@ -80,17 +80,14 @@ decode_leb128s(u8 *at, s32 *dest) while (1) { byte = at[offset++]; - result |= ((byte & 127) << shift); - + shift += 7; if ((byte & 128) == 0) { break; } - - shift += 7; } - if ((shift < size) && (byte & 128)) { + if ((shift < size) && (byte & 64)) { result |= -(1 << shift); }