diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-02-10 11:24:44 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-02-10 12:58:35 -0800 |
| commit | fc028c30a0570e097f4f16f9731c1433226e5367 (patch) | |
| tree | 909bf3201cd6f3a9e61b1a63533f5f0d64fd7035 /src/rt/rust_stack.h | |
| parent | 5fc2e9e9ab9cf0329fb9f18c28c2df545e4e3edc (diff) | |
| download | rust-fc028c30a0570e097f4f16f9731c1433226e5367.tar.gz rust-fc028c30a0570e097f4f16f9731c1433226e5367.zip | |
rt: Move the addition of the stack canary into create_stack
Diffstat (limited to 'src/rt/rust_stack.h')
| -rw-r--r-- | src/rt/rust_stack.h | 7 |
1 files changed, 4 insertions, 3 deletions
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 <class T> 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; } @@ -36,9 +40,6 @@ void unconfig_valgrind_stack(stk_seg *stk); void -add_stack_canary(stk_seg *stk); - -void check_stack_canary(stk_seg *stk); #endif /* RUST_STACK_H */ |
