diff options
author | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2011-04-14 19:36:05 (GMT) |
---|---|---|
committer | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2011-04-14 19:36:05 (GMT) |
commit | c006f8c12bc74131692a2df8fd64dcedeafe6c77 (patch) | |
tree | 245c3119b6d5b8f63903e93d22d5deecb634f06e /src/gtest-death-test.cc | |
parent | 6a5a25b1e10e9c3c3f4edef0ce322cdf8ce97866 (diff) | |
download | googletest-c006f8c12bc74131692a2df8fd64dcedeafe6c77.zip googletest-c006f8c12bc74131692a2df8fd64dcedeafe6c77.tar.gz googletest-c006f8c12bc74131692a2df8fd64dcedeafe6c77.tar.bz2 |
fixes a problem caused by gcc 4.6 optimization (by Paul Pluzhnikov)
Diffstat (limited to 'src/gtest-death-test.cc')
-rw-r--r-- | src/gtest-death-test.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gtest-death-test.cc b/src/gtest-death-test.cc index 603fccc..8b2e413 100644 --- a/src/gtest-death-test.cc +++ b/src/gtest-death-test.cc @@ -932,6 +932,11 @@ static int ExecDeathTestChildMain(void* child_arg) { // This could be accomplished more elegantly by a single recursive // function, but we want to guard against the unlikely possibility of // a smart compiler optimizing the recursion away. +// +// GTEST_NO_INLINE_ is required to prevent GCC 4.6 from inlining +// StackLowerThanAddress into StackGrowsDown, which then doesn't give +// correct answer. +bool StackLowerThanAddress(const void* ptr) GTEST_NO_INLINE_; bool StackLowerThanAddress(const void* ptr) { int dummy; return &dummy < ptr; |