about summary refs log tree commit diff stats
path: root/src/emu
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu')
-rwxr-xr-xsrc/emu/x64emu.c5
-rwxr-xr-xsrc/emu/x64run.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/emu/x64emu.c b/src/emu/x64emu.c
index f92a81bd..9a162dea 100755
--- a/src/emu/x64emu.c
+++ b/src/emu/x64emu.c
@@ -5,6 +5,7 @@
 #include <unistd.h>
 #include <sys/syscall.h>
 #include <sys/time.h>
+#include <sys/mman.h>
 
 #include "debug.h"
 #include "box64stack.h"
@@ -173,8 +174,8 @@ void CallAllCleanup(x64emu_t *emu)
 
 static void internalFreeX64(x64emu_t* emu)
 {
-    if(emu)
-        free(emu->stack2free);
+    if(emu && emu->stack2free)
+        munmap(emu->stack2free, emu->size_stack);
 }
 
 EXPORTDYN
diff --git a/src/emu/x64run.c b/src/emu/x64run.c
index e894fa87..237f7de1 100755
--- a/src/emu/x64run.c
+++ b/src/emu/x64run.c
@@ -48,7 +48,7 @@ int Run(x64emu_t *emu, int step)
         return 0;
 
     //ref opcode: http://ref.x64asm.net/geek32.html#xA1
-    printf_log(LOG_DEBUG, "Run X86 (%p), RIP=%p, Stack=%p\n", emu, (void*)R_RIP, emu->context->stack);
+    printf_log(LOG_DEBUG, "Run X86 (%p), RIP=%p, Stack=%p\n", emu, (void*)R_RIP, (void*)R_RSP);
 
 x64emurun: