Title: [233542] trunk/Source/WTF
Revision
233542
Author
[email protected]
Date
2018-07-05 14:46:35 -0700 (Thu, 05 Jul 2018)

Log Message

Unreviewed, rolling out r233417 and r233418.
https://bugs.webkit.org/show_bug.cgi?id=187364

Introduced an occasional crash on Google Drive (Requested by
rniwa on #webkit).

Reverted changesets:

"WTF's internal std::optional implementation should abort() on
bad optional access"
https://bugs.webkit.org/show_bug.cgi?id=186536
https://trac.webkit.org/changeset/233417

"WTF's internal std::optional implementation should abort() on
bad optional access"
https://bugs.webkit.org/show_bug.cgi?id=186536
https://trac.webkit.org/changeset/233418

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (233541 => 233542)


--- trunk/Source/WTF/ChangeLog	2018-07-05 21:43:35 UTC (rev 233541)
+++ trunk/Source/WTF/ChangeLog	2018-07-05 21:46:35 UTC (rev 233542)
@@ -1,3 +1,23 @@
+2018-07-05  Commit Queue  <[email protected]>
+
+        Unreviewed, rolling out r233417 and r233418.
+        https://bugs.webkit.org/show_bug.cgi?id=187364
+
+        Introduced an occasional crash on Google Drive (Requested by
+        rniwa on #webkit).
+
+        Reverted changesets:
+
+        "WTF's internal std::optional implementation should abort() on
+        bad optional access"
+        https://bugs.webkit.org/show_bug.cgi?id=186536
+        https://trac.webkit.org/changeset/233417
+
+        "WTF's internal std::optional implementation should abort() on
+        bad optional access"
+        https://bugs.webkit.org/show_bug.cgi?id=186536
+        https://trac.webkit.org/changeset/233418
+
 2018-07-04  Guillaume Emont  <[email protected]>
 
         FunctionTraits: Make cCallArity() constant on 32-bits.

Modified: trunk/Source/WTF/wtf/Assertions.h (233541 => 233542)


--- trunk/Source/WTF/wtf/Assertions.h	2018-07-05 21:43:35 UTC (rev 233541)
+++ trunk/Source/WTF/wtf/Assertions.h	2018-07-05 21:46:35 UTC (rev 233542)
@@ -220,12 +220,6 @@
 #define WTFBreakpointTrap() WTFCrash() // Not implemented.
 #endif
 
-#if COMPILER(MSVC)
-#define WTFBreakpointTrapUnderConstexprContext() __debugbreak()
-#else
-#define WTFBreakpointTrapUnderConstexprContext() __builtin_trap()
-#endif
-
 #ifndef CRASH
 
 #if defined(NDEBUG) && OS(DARWIN)
@@ -236,13 +230,8 @@
     WTFBreakpointTrap(); \
     __builtin_unreachable(); \
 } while (0)
-#define CRASH_UNDER_CONSTEXPR_CONTEXT() do { \
-    WTFBreakpointTrapUnderConstexprContext(); \
-    __builtin_unreachable(); \
-} while (0)
 #else
 #define CRASH() WTFCrash()
-#define CRASH_UNDER_CONSTEXPR_CONTEXT() WTFCrash()
 #endif
 
 #endif // !defined(CRASH)
@@ -516,25 +505,6 @@
 #define RELEASE_ASSERT_NOT_REACHED() ASSERT_NOT_REACHED()
 #endif
 
-/* RELEASE_ASSERT_UNDER_CONSTEXPR_CONTEXT
-
-   This is a special version of RELEASE_ASSERT(assertion) that can be used in constexpr contexts.
-*/
-#if ASSERT_DISABLED
-#define RELEASE_ASSERT_UNDER_CONSTEXPR_CONTEXT(assertion) do { \
-    if (UNLIKELY(!(assertion))) { \
-        CRASH_UNDER_CONSTEXPR_CONTEXT(); \
-    } \
-} while (0)
-#else
-#define RELEASE_ASSERT_UNDER_CONSTEXPR_CONTEXT(assertion) do { \
-    if (!(assertion)) { \
-        WTFReportAssertionFailure(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, #assertion); \
-        CRASH_UNDER_CONSTEXPR_CONTEXT(); \
-    } \
-} while (0)
-#endif
-
 /* UNREACHABLE_FOR_PLATFORM */
 
 #if COMPILER(CLANG)

Modified: trunk/Source/WTF/wtf/Optional.h (233541 => 233542)


--- trunk/Source/WTF/wtf/Optional.h	2018-07-05 21:43:35 UTC (rev 233541)
+++ trunk/Source/WTF/wtf/Optional.h	2018-07-05 21:46:35 UTC (rev 233542)
@@ -530,7 +530,8 @@
   }
 
   OPTIONAL_MUTABLE_CONSTEXPR T* operator ->() {
-    RELEASE_ASSERT_UNDER_CONSTEXPR_CONTEXT(initialized());
+    // FIXME: We need to offer special assert function that can be used under the contexpr context.
+    // CONSTEXPR_ASSERT(initialized());
     return dataptr();
   }
 
@@ -539,27 +540,32 @@
   }
 
   OPTIONAL_MUTABLE_CONSTEXPR T& operator *() & {
-    RELEASE_ASSERT_UNDER_CONSTEXPR_CONTEXT(initialized());
+    // FIXME: We need to offer special assert function that can be used under the contexpr context.
+    // CONSTEXPR_ASSERT(initialized());
     return contained_val();
   }
 
   OPTIONAL_MUTABLE_CONSTEXPR T&& operator *() && {
-    RELEASE_ASSERT_UNDER_CONSTEXPR_CONTEXT(initialized());
+    // FIXME: We need to offer special assert function that can be used under the contexpr context.
+    // CONSTEXPR_ASSERT(initialized());
     return detail_::constexpr_move(contained_val());
   }
 
   constexpr T const& value() const& {
-    RELEASE_ASSERT_UNDER_CONSTEXPR_CONTEXT(initialized());
+    // FIXME: We need to offer special assert function that can be used under the contexpr context.
+    // return initialized() ? contained_val() : (throw bad_optional_access("bad optional access"), contained_val());
     return contained_val();
   }
 
   OPTIONAL_MUTABLE_CONSTEXPR T& value() & {
-    RELEASE_ASSERT_UNDER_CONSTEXPR_CONTEXT(initialized());
+    // FIXME: We need to offer special assert function that can be used under the contexpr context.
+    // return initialized() ? contained_val() : (throw bad_optional_access("bad optional access"), contained_val());
     return contained_val();
   }
 
   OPTIONAL_MUTABLE_CONSTEXPR T&& value() && {
-    RELEASE_ASSERT_UNDER_CONSTEXPR_CONTEXT(initialized());
+    // FIXME: We need to offer special assert function that can be used under the contexpr context.
+    // if (!initialized()) __THROW_EXCEPTION(bad_optional_access("bad optional access"));
     return std::move(contained_val());
   }
 
@@ -677,7 +683,8 @@
   }
 
   constexpr T& value() const {
-    RELEASE_ASSERT_UNDER_CONSTEXPR_CONTEXT(ref());
+    // FIXME: We need to offer special assert function that can be used under the contexpr context.
+    // return ref ? *ref : (throw bad_optional_access("bad optional access"), *ref);
     return *ref;
   }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to