about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2023-07-30 23:40:14 +0200
committerptitSeb <sebastien.chev@gmail.com>2023-07-30 23:40:14 +0200
commit6b5ee5ecb5dae709d2aaf1c67e31a6a209b23e27 (patch)
tree29be2878df5a6ef9965af896c724be9a56b257f0 /src
parentf3a9224547da0b5cbfb5f531ab1295000ab70509 (diff)
downloadbox64-6b5ee5ecb5dae709d2aaf1c67e31a6a209b23e27.tar.gz
box64-6b5ee5ecb5dae709d2aaf1c67e31a6a209b23e27.zip
Fixed non-dynarec behavior on setjmp
Diffstat (limited to 'src')
-rw-r--r--src/dynarec/dynarec.c4
-rw-r--r--src/elfs/elfloader.c6
2 files changed, 6 insertions, 4 deletions
diff --git a/src/dynarec/dynarec.c b/src/dynarec/dynarec.c
index a67cb7cb..9c2fb4c0 100644
--- a/src/dynarec/dynarec.c
+++ b/src/dynarec/dynarec.c
@@ -151,10 +151,10 @@ void DynaRun(x64emu_t* emu)
                 emu->fork = 0;
                 emu = x64emu_fork(emu, forktype);
             }
-            if(emu->need_jmpbuf)
-                emu->quit = 0;
         }
 #endif
+        if(emu->need_jmpbuf)
+            emu->quit = 0;
     }
     // clear the setjmp
     emu->jmpbuf = old_jmpbuf;
diff --git a/src/elfs/elfloader.c b/src/elfs/elfloader.c
index 5a0890cf..265a6241 100644
--- a/src/elfs/elfloader.c
+++ b/src/elfs/elfloader.c
@@ -311,8 +311,10 @@ void FreeElfMemory(elfheader_t* head)
         for(int i=0; i<head->multiblock_n; ++i) {
 #ifdef DYNAREC
             dynarec_log(LOG_INFO, "Free DynaBlocks for %s\n", head->path);
-            cleanDBFromAddressRange((uintptr_t)head->multiblock[i], head->multiblock_size[i], 1);
-            freeProtection((uintptr_t)head->multiblock[i], head->multiblock_size[i]);
+            if(box64_dynarec) {
+                cleanDBFromAddressRange((uintptr_t)head->multiblock[i], head->multiblock_size[i], 1);
+                freeProtection((uintptr_t)head->multiblock[i], head->multiblock_size[i]);
+            }
 #endif
             munmap(head->multiblock[i], head->multiblock_size[i]);
         }