about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2023-12-07 22:14:14 +0100
committerptitSeb <sebastien.chev@gmail.com>2023-12-07 22:14:14 +0100
commit6ab86657ff18c00dbbc6fb229783930766e5742e (patch)
tree54e6388f1fc7ae8d1e4b91d4c4ed41f1409f5f88
parentaed66d81b38981f7ea9ee92ebe7d803a10df113f (diff)
downloadbox64-6ab86657ff18c00dbbc6fb229783930766e5742e.tar.gz
box64-6ab86657ff18c00dbbc6fb229783930766e5742e.zip
Fixes DynaCall when a uc_link has been setup before
-rw-r--r--src/dynarec/dynarec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dynarec/dynarec.c b/src/dynarec/dynarec.c
index 16c1c464..a46997f8 100644
--- a/src/dynarec/dynarec.c
+++ b/src/dynarec/dynarec.c
@@ -89,6 +89,9 @@ void DynaCall(x64emu_t* emu, uintptr_t addr)
     multiuint_t old_op1_sav= emu->op1_sav;
     multiuint_t old_res_sav= emu->res_sav;
     deferred_flags_t old_df_sav= emu->df_sav;
+    // uc_link
+    x64_ucontext_t* old_uc_link = emu->uc_link;
+    emu->uc_link = NULL;
 
     PushExit(emu);
     R_RIP = addr;
@@ -96,6 +99,7 @@ void DynaCall(x64emu_t* emu, uintptr_t addr)
     DynaRun(emu);
     emu->quit = 0;  // reset Quit flags...
     emu->df = d_none;
+    emu->uc_link = old_uc_link;
     if(emu->flags.quitonlongjmp && emu->flags.longjmp) {
         if(emu->flags.quitonlongjmp==1)
             emu->flags.longjmp = 0;   // don't change anything because of the longjmp