>> +  if (byte & 0x80) >> +    return read_unsigned_LEB_128_x(buffer, plen, byte); > > Write ((byte & 0x80) != 0) > >> +  if (byte & 0x80) >> +    return read_signed_LEB_128_x(buffer, plen, byte); > > Here too. > > This is OK with those changes. Done and committed, thanks. The patch as committed is attached... -cary 2012-01-24 Cary Coutant * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline definition and ... (read_unsigned_LEB_128_x): ... this new function. (read_signed_LEB_128): Replaced with inline definition and ... (read_signed_LEB_128_x): ... this new function. * int_encoding.h (read_unsigned_LEB_128_x): New function. (read_unsigned_LEB_128): Add inline definition. (read_signed_LEB_128_x): New function. (read_signed_LEB_128): Add inline definition. * testsuite/Makefile.am (leb128_unittest): New unit test. * testsuite/Makefile.in: Regenerate. * testsuite/leb128_unittest.cc: New unit test.