1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-06-18 07:41:44 +02:00
libunwind-eh_elf/src/mi/_ReadULEB.c
2004-04-20 16:53:44 +00:00

21 lines
323 B
C

#include <libunwind.h>
unw_word_t
_ReadULEB (unsigned char **dpp)
{
unsigned shift = 0;
unw_word_t byte, result = 0;
unsigned char *bp = *dpp;
while (1)
{
byte = *bp++;
result |= (byte & 0x7f) << shift;
if ((byte & 0x80) == 0)
break;
shift += 7;
}
*dpp = bp;
return result;
}