]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
(i386_disasm): If instruction matches prefix, undoing the prefix match
authorUlrich Drepper <drepper@redhat.com>
Thu, 18 Dec 2008 06:24:14 +0000 (22:24 -0800)
committerUlrich Drepper <drepper@redhat.com>
Thu, 18 Dec 2008 06:24:14 +0000 (22:24 -0800)
finishes the instruction.

libcpu/i386_disasm.c

index 843fd74988a82e4521807aa218f8820d532f0577..b676216a8eaa2504eea160f7581a0ab020457b5e 100644 (file)
@@ -351,13 +351,12 @@ i386_disasm (const uint8_t **startp, const uint8_t *end, GElf_Addr addr,
              opoff = 8;
 
              curr += 2;
-             assert (avail > 0);
 
              assert (last_prefix_bit != 0);
              correct_prefix = last_prefix_bit;
            }
 
-         do
+         while (avail > 0)
            {
              uint_fast8_t masked = *codep++ & *curr++;
              if (masked != *curr++)
@@ -367,7 +366,6 @@ i386_disasm (const uint8_t **startp, const uint8_t *end, GElf_Addr addr,
              if (codep == end && avail > 0)
                goto do_ret;
            }
-         while (avail > 0);
 
          if (avail != 0)
            {