diff options
author | Yabin Cui | 2014-12-11 19:38:32 -0600 |
---|---|---|
committer | Gerrit Code Review | 2014-12-11 19:38:33 -0600 |
commit | 6d634f9baaf804a91c97e019c832c1e9611a903a (patch) | |
tree | d7423d22bfdb08291ddbacba72b2a24ac6e18e36 | |
parent | 3115b34c9299d69919de39d01bfbbbe5e798e3b2 (diff) | |
parent | 562ae1e6e42e83f674507d2b915deb503200befe (diff) | |
download | platform-bionic-6d634f9baaf804a91c97e019c832c1e9611a903a.tar.gz platform-bionic-6d634f9baaf804a91c97e019c832c1e9611a903a.tar.xz platform-bionic-6d634f9baaf804a91c97e019c832c1e9611a903a.zip |
Merge "make stack_protector_DeathTest work for gcc4.9"
-rw-r--r-- | tests/stack_protector_test.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/stack_protector_test.cpp b/tests/stack_protector_test.cpp index aad51ecf..80077113 100644 --- a/tests/stack_protector_test.cpp +++ b/tests/stack_protector_test.cpp | |||
@@ -106,10 +106,16 @@ extern "C" uintptr_t __stack_chk_guard; | |||
106 | * This must be marked with "__attribute__ ((noinline))", to ensure the | 106 | * This must be marked with "__attribute__ ((noinline))", to ensure the |
107 | * compiler generates the proper stack guards around this function. | 107 | * compiler generates the proper stack guards around this function. |
108 | */ | 108 | */ |
109 | static char* dummy_buf; | ||
110 | |||
109 | __attribute__ ((noinline)) | 111 | __attribute__ ((noinline)) |
110 | static void do_modify_stack_chk_guard() { | 112 | static void do_modify_stack_chk_guard() { |
113 | char buf[128]; | ||
114 | // Store local array's address to global variable to force compiler to generate stack guards. | ||
115 | dummy_buf = buf; | ||
111 | __stack_chk_guard = 0x12345678; | 116 | __stack_chk_guard = 0x12345678; |
112 | } | 117 | } |
118 | |||
113 | #endif | 119 | #endif |
114 | 120 | ||
115 | TEST(stack_protector, global_guard) { | 121 | TEST(stack_protector, global_guard) { |