fixes a problem caused by gcc 4.6 optimization (by Paul Pluzhnikov)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user