From: Julian Seward Date: Sat, 5 Oct 2002 14:42:39 +0000 (+0000) Subject: merge rev 1.29.2.6: X-Git-Tag: svn/VALGRIND_1_9_4~239 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=64e5d306776a05ffd32098bf04177862fa5d9df9;p=thirdparty%2Fvalgrind.git merge rev 1.29.2.6: Fix really stupid bug in REP SCAS. Also (head only) add a bunch of asserts to guard against use of seg override prefixes in conjunction with string ops; these are not yet implemented. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1188 --- diff --git a/coregrind/vg_to_ucode.c b/coregrind/vg_to_ucode.c index 82e505cd23..7e459cb8d8 100644 --- a/coregrind/vg_to_ucode.c +++ b/coregrind/vg_to_ucode.c @@ -4123,38 +4123,46 @@ static Addr disInstr ( UCodeBlock* cb, Addr eip, Bool* isEnd ) /* ------------------------ SCAS et al ----------------- */ case 0xA4: /* MOVSb, no REP prefix */ + vg_assert(sorb == 0); codegen_MOVS ( cb, 1 ); if (dis) VG_(printf)("movsb\n"); break; case 0xA5: /* MOVSv, no REP prefix */ + vg_assert(sorb == 0); codegen_MOVS ( cb, sz ); if (dis) VG_(printf)("movs%c\n", nameISize(sz)); break; case 0xA6: /* CMPSb, no REP prefix */ + vg_assert(sorb == 0); codegen_CMPS ( cb, 1 ); if (dis) VG_(printf)("cmpsb\n"); break; case 0xAA: /* STOSb, no REP prefix */ + vg_assert(sorb == 0); codegen_STOS ( cb, 1 ); if (dis) VG_(printf)("stosb\n"); break; case 0xAB: /* STOSv, no REP prefix */ + vg_assert(sorb == 0); codegen_STOS ( cb, sz ); if (dis) VG_(printf)("stos%c\n", nameISize(sz)); break; case 0xAC: /* LODSb, no REP prefix */ + vg_assert(sorb == 0); codegen_LODS ( cb, 1 ); if (dis) VG_(printf)("lodsb\n"); break; case 0xAD: /* LODSv, no REP prefix */ + vg_assert(sorb == 0); codegen_LODS ( cb, sz ); if (dis) VG_(printf)("lods%c\n", nameISize(sz)); break; case 0xAE: /* SCASb, no REP prefix */ + vg_assert(sorb == 0); codegen_SCAS ( cb, 1 ); if (dis) VG_(printf)("scasb\n"); break; @@ -4193,10 +4201,11 @@ static Addr disInstr ( UCodeBlock* cb, Addr eip, Bool* isEnd ) case 0xF2: { /* REPNE prefix insn */ Addr eip_orig = eip - 1; + vg_assert(sorb == 0); abyte = getUChar(eip); eip++; if (abyte == 0x66) { sz = 2; abyte = getUChar(eip); eip++; } - if (abyte == 0xAE || 0xAF) { /* REPNE SCAS */ + if (abyte == 0xAE || abyte == 0xAF) { /* REPNE SCAS */ if (abyte == 0xAE) sz = 1; codegen_REPNE_SCAS ( cb, sz, eip_orig, eip ); *isEnd = True; @@ -4211,6 +4220,7 @@ static Addr disInstr ( UCodeBlock* cb, Addr eip, Bool* isEnd ) case 0xF3: { /* REPE prefix insn */ Addr eip_orig = eip - 1; + vg_assert(sorb == 0); abyte = getUChar(eip); eip++; if (abyte == 0x66) { sz = 2; abyte = getUChar(eip); eip++; }