dev-cpp/gtest: Update gtest-9999-fix-gcc6-undefined-behavior.patch
authorPeter Levine <plevine457@gmail.com>
Fri, 14 Sep 2018 00:39:00 +0000 (20:39 -0400)
committerMichał Górny <mgorny@gentoo.org>
Sat, 22 Sep 2018 07:07:09 +0000 (09:07 +0200)
Package-Manager: Portage-2.3.49, Repoman-2.3.10

dev-cpp/gtest/files/gtest-1.8.0-fix-gcc6-undefined-behavior.patch [new file with mode: 0644]
dev-cpp/gtest/files/gtest-9999-fix-gcc6-undefined-behavior.patch
dev-cpp/gtest/gtest-1.8.0-r1.ebuild
dev-cpp/gtest/gtest-1.8.0.ebuild

diff --git a/dev-cpp/gtest/files/gtest-1.8.0-fix-gcc6-undefined-behavior.patch b/dev-cpp/gtest/files/gtest-1.8.0-fix-gcc6-undefined-behavior.patch
new file mode 100644 (file)
index 0000000..eadfe61
--- /dev/null
@@ -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);
index eadfe6197389659badc3c8f78a6eb3d51d33f81c..8dfed46d458502d5a453b0f8d46997bc14e1f1d2 100644 (file)
@@ -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);
index 96cb8b936bfb122526adc7417014d9c77f8152ed..3fd0d1438bea174406c76fbd6ad5212fd3fc016b 100644 (file)
@@ -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
index 3dbd8e1a06d4e3ba01a0d84a2b8752b5e7ed99b2..fec38c4bc247e37ce3731e0c8c73e90c733e6d45 100644 (file)
@@ -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
 )