Title: [289640] trunk/Source/WebCore
- Revision
- 289640
- Author
- [email protected]
- Date
- 2022-02-11 11:36:44 -0800 (Fri, 11 Feb 2022)
Log Message
Keep promise in scope when calling DeferredPromise::reject
https://bugs.webkit.org/show_bug.cgi?id=236454
Patch by Gabriel Nava Marino <[email protected]> on 2022-02-11
Reviewed by Youenn Fablet.
Keep promise in scope when calling DeferredPromise::reject, as createDOMException
could go through a path that invokes GC on its owner and the promise.
* bindings/js/JSDOMPromiseDeferred.cpp:
(WebCore::DeferredPromise::reject):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (289639 => 289640)
--- trunk/Source/WebCore/ChangeLog 2022-02-11 19:34:51 UTC (rev 289639)
+++ trunk/Source/WebCore/ChangeLog 2022-02-11 19:36:44 UTC (rev 289640)
@@ -1,3 +1,16 @@
+2022-02-11 Gabriel Nava Marino <[email protected]>
+
+ Keep promise in scope when calling DeferredPromise::reject
+ https://bugs.webkit.org/show_bug.cgi?id=236454
+
+ Reviewed by Youenn Fablet.
+
+ Keep promise in scope when calling DeferredPromise::reject, as createDOMException
+ could go through a path that invokes GC on its owner and the promise.
+
+ * bindings/js/JSDOMPromiseDeferred.cpp:
+ (WebCore::DeferredPromise::reject):
+
2022-02-11 Tim Nguyen <[email protected]>
Unreviewed build fix: revert r289616
Modified: trunk/Source/WebCore/bindings/js/JSDOMPromiseDeferred.cpp (289639 => 289640)
--- trunk/Source/WebCore/bindings/js/JSDOMPromiseDeferred.cpp 2022-02-11 19:34:51 UTC (rev 289639)
+++ trunk/Source/WebCore/bindings/js/JSDOMPromiseDeferred.cpp 2022-02-11 19:36:44 UTC (rev 289640)
@@ -132,6 +132,7 @@
if (shouldIgnoreRequestToFulfill())
return;
+ Ref protectedThis(*this);
ASSERT(deferred());
ASSERT(m_globalObject);
auto& lexicalGlobalObject = *m_globalObject;
@@ -166,6 +167,7 @@
if (shouldIgnoreRequestToFulfill())
return;
+ Ref protectedThis(*this);
ASSERT(deferred());
ASSERT(m_globalObject);
auto& lexicalGlobalObject = *m_globalObject;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes