From 274dc2fb2c637dce87e03364ce515c12776e2db4 Mon Sep 17 00:00:00 2001 From: CleverMouse Date: Fri, 23 Dec 2016 16:21:08 +0000 Subject: [PATCH] free the stack at exit git-svn-id: svn://kolibrios.org@6812 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/system/os/thread.inc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/programs/system/os/thread.inc b/programs/system/os/thread.inc index 39098166f8..5faffcbe33 100644 --- a/programs/system/os/thread.inc +++ b/programs/system/os/thread.inc @@ -61,8 +61,13 @@ endp ; Terminates the current thread. ; exit_code is reserved; currently ignored proc exit_thread stdcall, exit_code +; Use int 0x40 instead of call FS_SYSCALL_PTR, because we are freeing the stack. + mov eax, 68 + mov ebx, 13 + mov ecx, FS_STACK_MIN + int 0x40 or eax, -1 - call FS_SYSCALL_PTR + int 0x40 endp ; Real entry point of threads created by create_thread.