1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-11-05 17:24:30 +01:00

(_ReadSLEB): Fix typo: shift needs to be increment before checking

for loop-exit.  Otherwise, sign-extension may clobber the
	most recently read 7 bits.

(Logical change 1.284)
This commit is contained in:
hp.com!davidm 2005-02-19 06:15:20 +00:00
parent 022a505678
commit 15df8b804c

View file

@ -11,9 +11,9 @@ _ReadSLEB (unsigned char **dpp)
{ {
byte = *bp++; byte = *bp++;
result |= (byte & 0x7f) << shift; result |= (byte & 0x7f) << shift;
shift += 7;
if ((byte & 0x80) == 0) if ((byte & 0x80) == 0)
break; break;
shift += 7;
} }
if (shift < 8 * sizeof (unw_word_t) && (byte & 0x40) != 0) if (shift < 8 * sizeof (unw_word_t) && (byte & 0x40) != 0)