diff options
Diffstat (limited to 'src/rt/rust_stack.h')
| -rw-r--r-- | src/rt/rust_stack.h | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/rt/rust_stack.h b/src/rt/rust_stack.h index f6704a9f0eb..e8be2f2c083 100644 --- a/src/rt/rust_stack.h +++ b/src/rt/rust_stack.h @@ -10,15 +10,11 @@ struct stk_seg { uint32_t pad; #endif + uintptr_t canary; + uint8_t data[]; }; -// A value that goes at the end of the stack and must not be touched -const uint8_t stack_canary[] = {0xAB, 0xCD, 0xAB, 0xCD, - 0xAB, 0xCD, 0xAB, 0xCD, - 0xAB, 0xCD, 0xAB, 0xCD, - 0xAB, 0xCD, 0xAB, 0xCD}; - // Used by create_stack void register_valgrind_stack(stk_seg *stk); @@ -34,7 +30,7 @@ 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 + sizeof(stack_canary); + size_t total_sz = sizeof(stk_seg) + sz; stk_seg *stk = (stk_seg *)allocer->malloc(total_sz, "stack"); memset(stk, 0, sizeof(stk_seg)); stk->end = (uintptr_t) &stk->data[sz]; |
