about summary refs log tree commit diff
path: root/src/rt/rust_stack.h
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-02-15 15:41:59 -0800
committerBrian Anderson <banderson@mozilla.com>2012-02-17 11:37:17 -0800
commit853e2003b8383749596e5b7b153186e2eef32455 (patch)
treed40153901e6b2bc8c8448f7a1c58adb440c8d385 /src/rt/rust_stack.h
parent2796ab6de9eefb3d009a410e45f5c154469c94b7 (diff)
downloadrust-853e2003b8383749596e5b7b153186e2eef32455.tar.gz
rust-853e2003b8383749596e5b7b153186e2eef32455.zip
rt: Make the stack canary just a word on the stk_seg struct
Diffstat (limited to 'src/rt/rust_stack.h')
-rw-r--r--src/rt/rust_stack.h10
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];