diff --git a/src/x86.cpp b/src/x86.cpp index 59959a2ce9..1854a01427 100644 --- a/src/x86.cpp +++ b/src/x86.cpp @@ -895,7 +895,7 @@ moveRR(Context* c, unsigned aSize, Assembler::Register* a, case 4: if (bSize == 8) { if (BytesPerWord == 8) { - alwaysRex(c, aSize, b, a); + alwaysRex(c, bSize, b, a); opcode(c, 0x63); modrm(c, 0xc0, a, b); } else { diff --git a/test/Longs.java b/test/Longs.java index daa6966677..51fad92969 100644 --- a/test/Longs.java +++ b/test/Longs.java @@ -35,7 +35,13 @@ public class Longs { return a - (a % b); } + private static int negativeOne() { + return -1; + } + public static void main(String[] args) { + expect(((long) negativeOne()) == -1); + { long foo = 25214903884L; int radix = 10; expect(foo > 0);