From 31edab584991ac16cdce706fbd2c81081af4030c Mon Sep 17 00:00:00 2001 From: Theodore Dubois Date: Tue, 29 May 2018 10:12:00 -0700 Subject: [PATCH] Save and restore all the clobbered registers --- emu/gadgets-x86/entry.S | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/emu/gadgets-x86/entry.S b/emu/gadgets-x86/entry.S index 2111d6a1..079f81e2 100644 --- a/emu/gadgets-x86/entry.S +++ b/emu/gadgets-x86/entry.S @@ -10,6 +10,9 @@ jit_enter: push %rbp push %rbx push %r12 + push %r13 + push %r14 + push %r15 leaq JIT_BLOCK_code(%rdi), %_ip movq %rsi, %_cpu leaq TLB_entries(%rdx), %_tlb @@ -41,6 +44,9 @@ jit_exit: movl %_esp, CPU_esp(%_cpu) # TODO more of those movl %_eip, CPU_eip(%_cpu) + pop %r15 + pop %r14 + pop %r13 pop %r12 pop %rbx pop %rbp