Skip to contentSkip to conversation

x86/emulator: Fix inline assembler warning

PATCH Applied Jan Kiszka 2 participants 2 messages Mar 9, 2015 – Mar 13, 2015 KVM

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 x86/emulator: Fix inline assembler warning

Code compiles to the same binary, but now with one warning less.

---
 x86/emulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
x86/emulator.c +1 -1
index 0964e6a..e5c1c6b 100644
@@ -838,7 +838,7 @@ static void test_jmp_noncanonical(uint64_t *mem)
 
 	exceptions = 0;
 	handle_exception(GP_VECTOR, advance_rip_by_3_and_note_exception);
-	asm volatile ("jmp %0" : : "m"(*mem));
+	asm volatile ("jmp *%0" : : "m"(*mem));
 	report("jump to non-canonical address", exceptions == 1);
 	handle_exception(GP_VECTOR, 0);
 }
Signature · 1 line
2.1.4
#1 lore raw
Quoted 22 lines · Jan Kiszka

Code compiles to the same binary, but now with one warning less.

---
 x86/emulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
x86/emulator.c +1 -1
index 0964e6a..e5c1c6b 100644
@@ -838,7 +838,7 @@ static void test_jmp_noncanonical(uint64_t *mem)
 
 	exceptions = 0;
 	handle_exception(GP_VECTOR, advance_rip_by_3_and_note_exception);
-	asm volatile ("jmp %0" : : "m"(*mem));
+	asm volatile ("jmp *%0" : : "m"(*mem));
 	report("jump to non-canonical address", exceptions == 1);
 	handle_exception(GP_VECTOR, 0);
 }
Signature · 1 line
2.1.4

Applied, thanks.