Commit b64c6270 authored by Alexandre Julliard's avatar Alexandre Julliard

Fixed rounding bug in the stack info calculation when we don't have

pthread_getattr_np.
parent a4e902cb
...@@ -72,8 +72,8 @@ void wine_pthread_init_thread( struct wine_pthread_thread_info *info ) ...@@ -72,8 +72,8 @@ void wine_pthread_init_thread( struct wine_pthread_thread_info *info )
#else #else
/* assume that the stack allocation is page aligned */ /* assume that the stack allocation is page aligned */
char dummy; char dummy;
size_t page_mask = getpagesize() - 1; size_t page_size = getpagesize();
char *stack_top = (char *)((unsigned long)(&dummy + page_mask) & ~page_mask); char *stack_top = (char *)((unsigned long)&dummy & ~(page_size - 1)) + page_size;
info->stack_base = stack_top - info->stack_size; info->stack_base = stack_top - info->stack_size;
#endif #endif
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment