From b64c627022f5f8175d366a2c8d81e0f05b2cc31c Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 30 Mar 2004 05:13:35 +0000 Subject: [PATCH] Fixed rounding bug in the stack info calculation when we don't have pthread_getattr_np. --- loader/pthread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/loader/pthread.c b/loader/pthread.c index e750843d3e6..af3386f2f46 100644 --- a/loader/pthread.c +++ b/loader/pthread.c @@ -72,8 +72,8 @@ void wine_pthread_init_thread( struct wine_pthread_thread_info *info ) #else /* assume that the stack allocation is page aligned */ char dummy; - size_t page_mask = getpagesize() - 1; - char *stack_top = (char *)((unsigned long)(&dummy + page_mask) & ~page_mask); + size_t page_size = getpagesize(); + char *stack_top = (char *)((unsigned long)&dummy & ~(page_size - 1)) + page_size; info->stack_base = stack_top - info->stack_size; #endif } -- 2.11.4.GIT