Skip to content
Snippets Groups Projects
Commit 05d4b2f8 authored by Ludwig Knüpfer's avatar Ludwig Knüpfer
Browse files

cpu/native: fix thread_stack_init

The pointer arithmetic for the calculation of the context storage was off
due to the change of the stack's pointer type from unsigned int to char.
Fix offset calculation by not adjusting for unsigned int width anymore.
parent eea0dd4e
No related branches found
No related tags found
No related merge requests found
...@@ -94,7 +94,7 @@ char *thread_stack_init(thread_task_func_t task_func, void *arg, void *stack_sta ...@@ -94,7 +94,7 @@ char *thread_stack_init(thread_task_func_t task_func, void *arg, void *stack_sta
stk = stack_start; stk = stack_start;
p = (ucontext_t *)(stk + ((stacksize - sizeof(ucontext_t)) / sizeof(void *))); p = (ucontext_t *)(stk + (stacksize - sizeof(ucontext_t)));
stacksize -= sizeof(ucontext_t); stacksize -= sizeof(ucontext_t);
if (getcontext(p) == -1) { if (getcontext(p) == -1) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment