* commit '96794bd9713882a4cd1452b7bca62729d10dc94c': make stack_protector_DeathTest work for gcc4.9
This commit is contained in:
		@@ -106,10 +106,16 @@ extern "C" uintptr_t __stack_chk_guard;
 | 
				
			|||||||
 * This must be marked with "__attribute__ ((noinline))", to ensure the
 | 
					 * This must be marked with "__attribute__ ((noinline))", to ensure the
 | 
				
			||||||
 * compiler generates the proper stack guards around this function.
 | 
					 * compiler generates the proper stack guards around this function.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					static char* dummy_buf;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
__attribute__ ((noinline))
 | 
					__attribute__ ((noinline))
 | 
				
			||||||
static void do_modify_stack_chk_guard() {
 | 
					static void do_modify_stack_chk_guard() {
 | 
				
			||||||
 | 
					  char buf[128];
 | 
				
			||||||
 | 
					  // Store local array's address to global variable to force compiler to generate stack guards.
 | 
				
			||||||
 | 
					  dummy_buf = buf;
 | 
				
			||||||
  __stack_chk_guard = 0x12345678;
 | 
					  __stack_chk_guard = 0x12345678;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
TEST(stack_protector, global_guard) {
 | 
					TEST(stack_protector, global_guard) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user