From 797acdf436ae098244c3415c795b128a366ce204 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Sun, 18 Jun 2006 21:32:33 +0200 Subject: [PATCH] dbghelp: dwarf: Tidy up leb128 reading. --- dlls/dbghelp/dwarf.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index be23e3ec06..18bf253ab3 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -207,13 +207,13 @@ static unsigned long dwarf2_leb128_as_unsigned(dwarf2_traverse_context_t* ctx) assert( NULL != ctx ); - while (1) + do { byte = dwarf2_parse_byte(ctx); ret |= (byte & 0x7f) << shift; shift += 7; - if (0 == (byte & 0x80)) { break ; } - } + } while (byte & 0x80); + return ret; } @@ -226,13 +226,13 @@ static long dwarf2_leb128_as_signed(dwarf2_traverse_context_t* ctx) assert( NULL != ctx ); - while (1) + do { byte = dwarf2_parse_byte(ctx); ret |= (byte & 0x7f) << shift; shift += 7; - if (0 == (byte & 0x80)) { break ; } - } + } while (byte & 0x80); + /* as spec: sign bit of byte is 2nd high order bit (80x40) * -> 0x80 is used as flag. */ -- 2.32.0.93.g670b81a890