Skip to content

Commit

Permalink
dev-cpp/gtest: Update gtest-9999-fix-gcc6-undefined-behavior.patch
Browse files Browse the repository at this point in the history
Package-Manager: Portage-2.3.49, Repoman-2.3.10
  • Loading branch information
Peter-Levine authored and mgorny committed Sep 22, 2018
1 parent 1836afd commit f526bd2
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 11 deletions.
21 changes: 21 additions & 0 deletions dev-cpp/gtest/files/gtest-1.8.0-fix-gcc6-undefined-behavior.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Fix build with GCC 6 due to lifetime issues.

--- a/googletest/src/gtest.cc
+++ b/googletest/src/gtest.cc
@@ -2654,10 +2654,12 @@
test->Run();
}

- // Deletes the test object.
- impl->os_stack_trace_getter()->UponLeavingGTest();
- internal::HandleExceptionsInMethodIfSupported(
- test, &Test::DeleteSelf_, "the test fixture's destructor");
+ if (test != NULL) {
+ // Deletes the test object.
+ impl->os_stack_trace_getter()->UponLeavingGTest();
+ internal::HandleExceptionsInMethodIfSupported(
+ test, &Test::DeleteSelf_, "the test fixture's destructor");
+ }

result_.set_elapsed_time(internal::GetTimeInMillis() - start);

14 changes: 5 additions & 9 deletions dev-cpp/gtest/files/gtest-9999-fix-gcc6-undefined-behavior.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@ Fix build with GCC 6 due to lifetime issues.

--- a/googletest/src/gtest.cc
+++ b/googletest/src/gtest.cc
@@ -2654,10 +2654,12 @@
@@ -2693,10 +2693,12 @@
test->Run();
}

- // Deletes the test object.
- impl->os_stack_trace_getter()->UponLeavingGTest();
- internal::HandleExceptionsInMethodIfSupported(
- test, &Test::DeleteSelf_, "the test fixture's destructor");
+ if (test != NULL) {
+ // Deletes the test object.
+ impl->os_stack_trace_getter()->UponLeavingGTest();
+ internal::HandleExceptionsInMethodIfSupported(
+ test, &Test::DeleteSelf_, "the test fixture's destructor");
// Deletes the test object.
impl->os_stack_trace_getter()->UponLeavingGTest();
internal::HandleExceptionsInMethodIfSupported(
test, &Test::DeleteSelf_, "the test fixture's destructor");
+ }

result_.set_elapsed_time(internal::GetTimeInMillis() - start);
Expand Down
2 changes: 1 addition & 1 deletion dev-cpp/gtest/gtest-1.8.0-r1.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RDEPEND="!dev-cpp/gmock"

PATCHES=(
"${FILESDIR}"/${PN}-9999-fix-py-tests.patch
"${FILESDIR}"/${PN}-9999-fix-gcc6-undefined-behavior.patch
"${FILESDIR}"/${PN}-1.8.0-fix-gcc6-undefined-behavior.patch
"${FILESDIR}"/${PN}-1.8.0-multilib-strict.patch
"${FILESDIR}"/${PN}-1.8.0-increase-clone-stack-size.patch
"${FILESDIR}"/${PN}-1.8.0-fix-doublefree.patch
Expand Down
2 changes: 1 addition & 1 deletion dev-cpp/gtest/gtest-1.8.0.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RDEPEND="!dev-cpp/gmock"

PATCHES=(
"${FILESDIR}"/${PN}-9999-fix-py-tests.patch
"${FILESDIR}"/${PN}-9999-fix-gcc6-undefined-behavior.patch
"${FILESDIR}"/${PN}-1.8.0-fix-gcc6-undefined-behavior.patch
"${FILESDIR}"/${PN}-1.8.0-multilib-strict.patch
"${FILESDIR}"/${PN}-1.8.0-increase-clone-stack-size.patch
)
Expand Down

0 comments on commit f526bd2

Please sign in to comment.