Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
f3cf0a23
Commit
f3cf0a23
authored
Jun 13, 2011
by
vladlosev
Browse files
Suppresses the tail-call optimization of StackGrowsDown() in GCC4.6 (by Paul Pluzhnikov).
parent
cc265df8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
src/gtest-death-test.cc
src/gtest-death-test.cc
+6
-4
No files found.
src/gtest-death-test.cc
View file @
f3cf0a23
...
@@ -936,15 +936,17 @@ static int ExecDeathTestChildMain(void* child_arg) {
...
@@ -936,15 +936,17 @@ static int ExecDeathTestChildMain(void* child_arg) {
// GTEST_NO_INLINE_ is required to prevent GCC 4.6 from inlining
// GTEST_NO_INLINE_ is required to prevent GCC 4.6 from inlining
// StackLowerThanAddress into StackGrowsDown, which then doesn't give
// StackLowerThanAddress into StackGrowsDown, which then doesn't give
// correct answer.
// correct answer.
bool
StackLowerThanAddress
(
const
void
*
ptr
)
GTEST_NO_INLINE_
;
void
StackLowerThanAddress
(
const
void
*
ptr
,
bool
*
result
)
GTEST_NO_INLINE_
;
bool
StackLowerThanAddress
(
const
void
*
ptr
)
{
void
StackLowerThanAddress
(
const
void
*
ptr
,
bool
*
result
)
{
int
dummy
;
int
dummy
;
re
turn
&
dummy
<
ptr
;
*
re
sult
=
(
&
dummy
<
ptr
)
;
}
}
bool
StackGrowsDown
()
{
bool
StackGrowsDown
()
{
int
dummy
;
int
dummy
;
return
StackLowerThanAddress
(
&
dummy
);
bool
result
;
StackLowerThanAddress
(
&
dummy
,
&
result
);
return
result
;
}
}
// A threadsafe implementation of fork(2) for threadsafe-style death tests
// A threadsafe implementation of fork(2) for threadsafe-style death tests
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment