From 23df4de86d8740545891a745f3c2f6c90cf1d1fd Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 15 Dec 2011 14:46:12 -0800 Subject: rt: Fix alignment of new stack segments --- src/rt/rust_task.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/rt/rust_task.cpp') diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp index ffcbcc1da5f..a95171951f6 100644 --- a/src/rt/rust_task.cpp +++ b/src/rt/rust_task.cpp @@ -596,10 +596,8 @@ rust_task::new_stack(size_t stk_sz, void *args_addr, size_t args_sz) { stk_seg *stk_seg = new_stk(sched, this, stk_sz + args_sz); uint8_t *new_sp = (uint8_t*)stk_seg->end; - size_t sizeof_retaddr = sizeof(void*); - // Make enough room on the new stack to hold the old stack pointer - // in addition to the function arguments - new_sp = align_down(new_sp - (args_sz + sizeof_retaddr)); + // Push the function arguments to the new stack + new_sp = align_down(new_sp - args_sz); memcpy(new_sp, args_addr, args_sz); record_stack_limit(); return new_sp; -- cgit 1.4.1-3-g733a5