From 6e4a1b55b1e783573d51386f2612c85b345bf938 Mon Sep 17 00:00:00 2001 From: Sven Steinbauer Date: Tue, 7 Jun 2016 10:01:35 +0100 Subject: [PATCH] Error if moving 64bit val to 32bit reg (#5088) mov eax, 0x1122334455667788 now errors if trying to assemble with -b64. --- libr/asm/p/asm_x86_nz.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libr/asm/p/asm_x86_nz.c b/libr/asm/p/asm_x86_nz.c index e4ec7f94e5..24b3cff901 100644 --- a/libr/asm/p/asm_x86_nz.c +++ b/libr/asm/p/asm_x86_nz.c @@ -1108,8 +1108,12 @@ SETNP/SETPO - Set if No Parity / Set if Parity Odd (386+) ptr = (ut8 *)&dst; if (dst > UT32_MAX) { if (a->bits == 64) { - if (*arg == 'r') + if (*arg == 'r') { data[l++] = 0x48; + } else { + eprintf ("Error: destination register is not 64 bit\n"); + return -1; + } data[1] = 0xb8 | getreg (arg); data[2] = ptr[0]; data[3] = ptr[1];