Title: [221711] trunk
Revision
221711
Author
[email protected]
Date
2017-09-06 17:57:35 -0700 (Wed, 06 Sep 2017)

Log Message

constructGenericTypedArrayViewWithArguments() is missing an exception check.
https://bugs.webkit.org/show_bug.cgi?id=176485
<rdar://problem/33898874>

Reviewed by Keith Miller.

JSTests:

* stress/regress-176485.js: Added.

Source/_javascript_Core:

* runtime/JSGenericTypedArrayViewConstructorInlines.h:
(JSC::constructGenericTypedArrayViewWithArguments):

Modified Paths

Added Paths

Diff

Modified: trunk/JSTests/ChangeLog (221710 => 221711)


--- trunk/JSTests/ChangeLog	2017-09-07 00:03:13 UTC (rev 221710)
+++ trunk/JSTests/ChangeLog	2017-09-07 00:57:35 UTC (rev 221711)
@@ -1,3 +1,13 @@
+2017-09-06  Mark Lam  <[email protected]>
+
+        constructGenericTypedArrayViewWithArguments() is missing an exception check.
+        https://bugs.webkit.org/show_bug.cgi?id=176485
+        <rdar://problem/33898874>
+
+        Reviewed by Keith Miller.
+
+        * stress/regress-176485.js: Added.
+
 2017-09-05  Saam Barati  <[email protected]>
 
         isNotCellSpeculation is wrong with respect to SpecEmpty

Added: trunk/JSTests/stress/regress-176485.js (0 => 221711)


--- trunk/JSTests/stress/regress-176485.js	                        (rev 0)
+++ trunk/JSTests/stress/regress-176485.js	2017-09-07 00:57:35 UTC (rev 221711)
@@ -0,0 +1,11 @@
+var exception;
+try {
+    a2 = {};//some method ok//what ever object//Date()
+    Object.defineProperty(a2, "length",{get: Int32Array});//Int32Array here wrong,need a function
+    new Int32Array(this.a2);
+} catch (e) {
+    exception = e;
+}
+
+if (exception != "TypeError: calling Int32Array constructor without new is invalid")
+    throw "Exception not thrown";

Modified: trunk/Source/_javascript_Core/ChangeLog (221710 => 221711)


--- trunk/Source/_javascript_Core/ChangeLog	2017-09-07 00:03:13 UTC (rev 221710)
+++ trunk/Source/_javascript_Core/ChangeLog	2017-09-07 00:57:35 UTC (rev 221711)
@@ -1,3 +1,14 @@
+2017-09-06  Mark Lam  <[email protected]>
+
+        constructGenericTypedArrayViewWithArguments() is missing an exception check.
+        https://bugs.webkit.org/show_bug.cgi?id=176485
+        <rdar://problem/33898874>
+
+        Reviewed by Keith Miller.
+
+        * runtime/JSGenericTypedArrayViewConstructorInlines.h:
+        (JSC::constructGenericTypedArrayViewWithArguments):
+
 2017-09-06  Saam Barati  <[email protected]>
 
         Air should have a Vector of prologue generators instead of a HashMap representing an optional prologue generator

Modified: trunk/Source/_javascript_Core/runtime/JSGenericTypedArrayViewConstructorInlines.h (221710 => 221711)


--- trunk/Source/_javascript_Core/runtime/JSGenericTypedArrayViewConstructorInlines.h	2017-09-07 00:03:13 UTC (rev 221710)
+++ trunk/Source/_javascript_Core/runtime/JSGenericTypedArrayViewConstructorInlines.h	2017-09-07 00:57:35 UTC (rev 221711)
@@ -185,8 +185,14 @@
                     return constructGenericTypedArrayViewFromIterator<ViewClass>(exec, structure, iterator);
             }
 
-            length = lengthSlot.isUnset() ? 0 : lengthSlot.getValue(exec, vm.propertyNames->length).toUInt32(exec);
-            RETURN_IF_EXCEPTION(scope, nullptr);
+            if (lengthSlot.isUnset())
+                length = 0;
+            else {
+                JSValue value = lengthSlot.getValue(exec, vm.propertyNames->length);
+                RETURN_IF_EXCEPTION(scope, nullptr);
+                length = value.toUInt32(exec);
+                RETURN_IF_EXCEPTION(scope, nullptr);
+            }
         }
 
         
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to