1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-26 15:03:53 +01:00

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.
This commit is contained in:
Ludwig Knüpfer 2016-07-22 21:50:39 +02:00
parent eea0dd4e32
commit 05d4b2f8fa

View File

@ -94,7 +94,7 @@ char *thread_stack_init(thread_task_func_t task_func, void *arg, void *stack_sta
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);
if (getcontext(p) == -1) {