ASSERTION FAILED: !m_needExceptionCheck with --validateExceptionChecks=1; ProxyObject...
authormsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 May 2019 02:04:07 +0000 (02:04 +0000)
committermsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 May 2019 02:04:07 +0000 (02:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197485

Reviewed by Saam Barati.

JSTests:

New test.

* stress/proxy-getOwnPropertySlots-exceptionChecks.js: Added.
(foo):

Source/JavaScriptCore:

Added an EXCEPTION_ASSERT after call to getOwnPropertySlot().

* runtime/JSObject.cpp:
(JSC::JSObject::getOwnPropertyDescriptor):

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

JSTests/ChangeLog
JSTests/stress/proxy-getOwnPropertySlots-exceptionChecks.js [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/JSObject.cpp

index 1e0fb75..6f52e30 100644 (file)
@@ -1,3 +1,15 @@
+2019-05-01  Michael Saboff  <msaboff@apple.com>
+
+        ASSERTION FAILED: !m_needExceptionCheck with --validateExceptionChecks=1; ProxyObject.getOwnPropertySlotCommon/JSFunction.callerGetter
+        https://bugs.webkit.org/show_bug.cgi?id=197485
+
+        Reviewed by Saam Barati.
+
+        New test.
+
+        * stress/proxy-getOwnPropertySlots-exceptionChecks.js: Added.
+        (foo):
+
 2019-05-01  Ross Kirsling  <ross.kirsling@sony.com>
 
         Unreviewed correction to Test262 expectations following r244828.
diff --git a/JSTests/stress/proxy-getOwnPropertySlots-exceptionChecks.js b/JSTests/stress/proxy-getOwnPropertySlots-exceptionChecks.js
new file mode 100644 (file)
index 0000000..9ffe0ce
--- /dev/null
@@ -0,0 +1,9 @@
+//@ runWithoutBaseOption("default", "--validateExceptionChecks=1")
+
+// This test that we have appropriate exception check processing Proxy.getOwnPropertySlots
+
+function foo()
+{
+}
+
+let a = {...new Proxy(foo, {})}
index 395fa64..0009eb3 100644 (file)
@@ -1,3 +1,15 @@
+2019-05-01  Michael Saboff  <msaboff@apple.com>
+
+        ASSERTION FAILED: !m_needExceptionCheck with --validateExceptionChecks=1; ProxyObject.getOwnPropertySlotCommon/JSFunction.callerGetter
+        https://bugs.webkit.org/show_bug.cgi?id=197485
+
+        Reviewed by Saam Barati.
+
+        Added an EXCEPTION_ASSERT after call to getOwnPropertySlot().
+
+        * runtime/JSObject.cpp:
+        (JSC::JSObject::getOwnPropertyDescriptor):
+
 2019-05-01  Ross Kirsling  <ross.kirsling@sony.com>
 
         RemoteInspector::updateAutomaticInspectionCandidate should have a default implementation.
index 8d3a0e7..e1d022e 100644 (file)
@@ -3441,10 +3441,14 @@ static JSCustomGetterSetterFunction* getCustomGetterSetterFunctionForGetterSette
 bool JSObject::getOwnPropertyDescriptor(ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
 {
     VM& vm = exec->vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
     JSC::PropertySlot slot(this, PropertySlot::InternalMethodType::GetOwnProperty);
     if (!methodTable(vm)->getOwnPropertySlot(this, exec, propertyName, slot))
         return false;
-
+    EXCEPTION_ASSERT(!scope.exception());
+    scope.release();
+    
     // DebuggerScope::getOwnPropertySlot() (and possibly others) may return attributes from the prototype chain
     // but getOwnPropertyDescriptor() should only work for 'own' properties so we exit early if we detect that
     // the property is not an own property.
@@ -3490,6 +3494,7 @@ bool JSObject::getOwnPropertyDescriptor(ExecState* exec, PropertyName propertyNa
             descriptor.setSetter(getCustomGetterSetterFunctionForGetterSetter(exec, propertyName, getterSetter, JSCustomGetterSetterFunction::Type::Setter));
     } else
         descriptor.setDescriptor(slot.getValue(exec, propertyName), slot.attributes());
+
     return true;
 }