WebKit Bugzilla
Attachment 343716 Details for
Bug 186536
: WTF's internal std::optional implementation should abort() on bad optional access
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186536-20180611175810.patch (text/plain), 3.15 KB, created by
Michael Catanzaro
on 2018-06-27 09:16:25 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Michael Catanzaro
Created:
2018-06-27 09:16:25 PDT
Size:
3.15 KB
patch
obsolete
>Subversion Revision: 232725 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index 43a7f596b05e11b11df643b8f033babe902fd461..cb2568cc7c12375a28b9d028b9bbcd87fb772e92 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,17 @@ >+2018-06-11 Michael Catanzaro <mcatanzaro@igalia.com> >+ >+ WTF's internal std::optional implementation should abort() on bad optional access >+ https://bugs.webkit.org/show_bug.cgi?id=186536 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * wtf/Optional.h: >+ (std::optional::operator ->): >+ (std::optional::operator *): >+ (std::optional::value const): >+ (std::optional::value): >+ (std::optional<T::value const): >+ > 2018-06-11 Michael Saboff <msaboff@apple.com> > > JavaScriptCore: Disable 32-bit JIT on Windows >diff --git a/Source/WTF/wtf/Optional.h b/Source/WTF/wtf/Optional.h >index 67ee27752ff908202b37ba85a71d1580f71b6101..e49ca85c536b92c7c9281bb8ad47805c86a3c103 100644 >--- a/Source/WTF/wtf/Optional.h >+++ b/Source/WTF/wtf/Optional.h >@@ -530,8 +530,7 @@ public: > } > > OPTIONAL_MUTABLE_CONSTEXPR T* operator ->() { >- // FIXME: We need to offer special assert function that can be used under the contexpr context. >- // CONSTEXPR_ASSERT(initialized()); >+ RELEASE_ASSERT(initialized()); > return dataptr(); > } > >@@ -540,32 +539,27 @@ public: > } > > OPTIONAL_MUTABLE_CONSTEXPR T& operator *() & { >- // FIXME: We need to offer special assert function that can be used under the contexpr context. >- // CONSTEXPR_ASSERT(initialized()); >+ RELEASE_ASSERT(initialized()); > return contained_val(); > } > > OPTIONAL_MUTABLE_CONSTEXPR T&& operator *() && { >- // FIXME: We need to offer special assert function that can be used under the contexpr context. >- // CONSTEXPR_ASSERT(initialized()); >+ RELEASE_ASSERT(initialized()); > return detail_::constexpr_move(contained_val()); > } > > constexpr T const& value() const& { >- // 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()); >+ RELEASE_ASSERT(initialized()); > return contained_val(); > } > > OPTIONAL_MUTABLE_CONSTEXPR T& value() & { >- // 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()); >+ RELEASE_ASSERT(initialized()); > return contained_val(); > } > > OPTIONAL_MUTABLE_CONSTEXPR T&& value() && { >- // 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")); >+ RELEASE_ASSERT(initialized()); > return std::move(contained_val()); > } > >@@ -683,8 +677,7 @@ public: > } > > constexpr T& value() const { >- // 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); >+ RELEASE_ASSERT(ref); > return *ref; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186536
:
342475
|
342491
|
342505
|
343716
|
343763
|
343812
|
343813
|
343840
|
343898
|
344000
|
344007
|
344009
|
344010
|
344081
|
344412
|
344420