fix encoding of single byte register-to-memory moves on x86_64

We need to prefix instructions of the form "mov R,M" with a REX byte
when R is %spl, %bpl, %sil, or %dil.  Such moves are unencodable on
32-bit x86, and, because of the order in which we pick registers,
pretty rare on 64-bit systems, which is why this took so long to
notice.
This commit is contained in:
Joel Dice 2010-02-02 11:37:08 -07:00
parent 5d781a0584
commit 3bc37d6e2a

View File

@ -518,7 +518,7 @@ void
maybeRex(Context* c, unsigned size, Assembler::Register* a,
Assembler::Memory* b)
{
maybeRex(c, size, a->low, b->index, b->base, false);
maybeRex(c, size, a->low, b->index, b->base, size == 1 and (a->low & 4));
}
void