diff --git a/src/rt/arch/i386/morestack.S b/src/rt/arch/i386/morestack.S index 30084ec2de0c..e90c521a302a 100644 --- a/src/rt/arch/i386/morestack.S +++ b/src/rt/arch/i386/morestack.S @@ -21,7 +21,7 @@ #define UPCALL_DEL_STACK _upcall_del_stack #define RUST_GET_TASK _rust_get_task #define UPCALL_CALL_C _upcall_call_shim_on_c_stack -#define MORESTACK __morestack +#define MORESTACK ___morestack #endif #endif @@ -44,7 +44,6 @@ .type MORESTACK,@function #endif -#if defined(__linux__) || defined(__APPLE__) MORESTACK: #ifdef __linux__ .cfi_startproc @@ -144,11 +143,6 @@ MORESTACK: .cfi_endproc #endif -#else -MORESTACK: - ret -#endif - #ifdef __APPLE__ .section __IMPORT,__pointers,non_lazy_symbol_pointers diff --git a/src/rt/arch/i386/record_sp.S b/src/rt/arch/i386/record_sp.S index 3f299de5d154..0c9f07828467 100644 --- a/src/rt/arch/i386/record_sp.S +++ b/src/rt/arch/i386/record_sp.S @@ -16,17 +16,21 @@ RECORD_SP: movl 4(%esp), %eax movl %eax, %gs:48 ret -#else +#endif + #if defined(__APPLE__) RECORD_SP: movl $0x48+90*4, %eax movl 4(%esp), %ecx movl %ecx, %gs:(%eax) ret -#else -RECORD_SP: - ret #endif + +#if defined(_WIN32) +RECORD_SP: + movl 4(%esp), %eax + movl %eax, %fs:0x14 + ret #endif GET_SP: diff --git a/src/rt/rust_scheduler.cpp b/src/rt/rust_scheduler.cpp index 601a7c3f0ef9..03567bbe19ad 100644 --- a/src/rt/rust_scheduler.cpp +++ b/src/rt/rust_scheduler.cpp @@ -394,6 +394,7 @@ void rust_scheduler::place_task_in_tls(rust_task *task) { BOOL result = TlsSetValue(task_key, task); assert(result && "Couldn't place the task in TLS!"); + task->record_stack_limit(); } rust_task *