From fc028c30a0570e097f4f16f9731c1433226e5367 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 10 Feb 2012 11:24:44 -0800 Subject: rt: Move the addition of the stack canary into create_stack --- src/rt/rust_stack.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/rt/rust_stack.h') diff --git a/src/rt/rust_stack.h b/src/rt/rust_stack.h index 5431d6ec2ff..6d5fea0c7ef 100644 --- a/src/rt/rust_stack.h +++ b/src/rt/rust_stack.h @@ -13,12 +13,16 @@ struct stk_seg { uint8_t data[]; }; +void +add_stack_canary(stk_seg *stk); + template stk_seg * create_stack(T allocer, size_t sz) { size_t total_sz = sizeof(stk_seg) + sz; stk_seg *stk = (stk_seg *)allocer->malloc(total_sz, "stack"); memset(stk, 0, sizeof(stk_seg)); + add_stack_canary(stk); stk->end = (uintptr_t) &stk->data[sz]; return stk; } @@ -35,9 +39,6 @@ config_valgrind_stack(stk_seg *stk); void unconfig_valgrind_stack(stk_seg *stk); -void -add_stack_canary(stk_seg *stk); - void check_stack_canary(stk_seg *stk); -- cgit 1.4.1-3-g733a5