OSDN Git Service

Fix the stack-protector test for x86/x86-64.
authorElliott Hughes <enh@google.com>
Fri, 1 Apr 2016 21:51:10 +0000 (14:51 -0700)
committerElliott Hughes <enh@google.com>
Sat, 2 Apr 2016 03:08:03 +0000 (20:08 -0700)
commit6057d184f548a5f17e2c9467228d167243d9736a
treedba67c4a0127309ae81e4a86a72d3236bbd18256
parent1e8958448a94753dec9c070ef011628c0b230d98
Fix the stack-protector test for x86/x86-64.

Built for fugu this was working fine, but built for generic x86/x86-64
the compiler was (a) optimizing out all the stack writes and (b) inserting
enough padding on x86-64 for the canary to be safely out of the way.

While here, let's tighten up this test so we test that it's sufficient to
only overwrite the buffer by one byte...

(cherry-pick of 6f90c1ac59eb4e7811b7b0e408615049c935c0a9.)

Bug: http://b/27815668
Change-Id: I80a646de4b30fd5c78df20fdaa7e3eb163585caf
tests/stack_protector_test_helper.cpp