[ Mac wk1 Debug ] imported/w3c/web-platform-tests/fetch/api/basic/stream-safe-creatio...
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 May 2020 14:01:10 +0000 (14:01 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 May 2020 14:01:10 +0000 (14:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=211923
<rdar://problem/63244249>

Reviewed by Mark Lam.

* runtime/JSObject.h:
(JSC::JSObject::get const):
When calling get, a terminate exception might happen if running in workers.
Return early in that case. Add an ASSERT that only terminated exceptions can actually happen.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261857 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/JSObject.h

index c3d5a31..652ba00 100644 (file)
@@ -1,3 +1,16 @@
+2020-05-19  Youenn Fablet  <youenn@apple.com>
+
+        [ Mac wk1 Debug ] imported/w3c/web-platform-tests/fetch/api/basic/stream-safe-creation.any.html  is flaky crashing with alerts - WTFCrashWithInfo - SC::JSObject::get(JSC::JSGlobalObject*, JSC::PropertyName)
+        https://bugs.webkit.org/show_bug.cgi?id=211923
+        <rdar://problem/63244249>
+
+        Reviewed by Mark Lam.
+
+        * runtime/JSObject.h:
+        (JSC::JSObject::get const):
+        When calling get, a terminate exception might happen if running in workers.
+        Return early in that case. Add an ASSERT that only terminated exceptions can actually happen.
+
 2020-05-18  Andy Estes  <aestes@apple.com>
 
         http/tests/ssl/applepay/ApplePayInstallmentConfiguration.https.html fails in public SDK builds
index 469894e..2fd6d97 100644 (file)
@@ -73,6 +73,7 @@ class ThrowScope;
 struct HashTable;
 struct HashTableValue;
 
+JS_EXPORT_PRIVATE bool isTerminatedExecutionException(VM&, Exception*);
 JS_EXPORT_PRIVATE Exception* throwTypeError(JSGlobalObject*, ThrowScope&, const String&);
 extern JS_EXPORT_PRIVATE const ASCIILiteral NonExtensibleObjectPropertyDefineError;
 extern JS_EXPORT_PRIVATE const ASCIILiteral ReadonlyPropertyWriteError;
@@ -1490,7 +1491,10 @@ inline JSValue JSObject::get(JSGlobalObject* globalObject, PropertyName property
     auto scope = DECLARE_THROW_SCOPE(vm);
     PropertySlot slot(this, PropertySlot::InternalMethodType::Get);
     bool hasProperty = const_cast<JSObject*>(this)->getPropertySlot(globalObject, propertyName, slot);
-    EXCEPTION_ASSERT(!scope.exception() || !hasProperty);
+
+    EXCEPTION_ASSERT(!scope.exception() || isTerminatedExecutionException(vm, scope.exception()) || !hasProperty);
+    RETURN_IF_EXCEPTION(scope, jsUndefined());
+
     if (hasProperty)
         RELEASE_AND_RETURN(scope, slot.getValue(globalObject, propertyName));
 
@@ -1503,7 +1507,10 @@ inline JSValue JSObject::get(JSGlobalObject* globalObject, unsigned propertyName
     auto scope = DECLARE_THROW_SCOPE(vm);
     PropertySlot slot(this, PropertySlot::InternalMethodType::Get);
     bool hasProperty = const_cast<JSObject*>(this)->getPropertySlot(globalObject, propertyName, slot);
-    EXCEPTION_ASSERT(!scope.exception() || !hasProperty);
+
+    EXCEPTION_ASSERT(!scope.exception() || isTerminatedExecutionException(vm, scope.exception()) || !hasProperty);
+    RETURN_IF_EXCEPTION(scope, jsUndefined());
+
     if (hasProperty)
         RELEASE_AND_RETURN(scope, slot.getValue(globalObject, propertyName));