Title: [266213] trunk/Source/_javascript_Core
Revision
266213
Author
[email protected]
Date
2020-08-26 18:47:20 -0700 (Wed, 26 Aug 2020)

Log Message

Make isIndex use MAX_ARRAY_INDEX
https://bugs.webkit.org/show_bug.cgi?id=215872

Reviewed by Darin Adler.

It's already written in such a way where it relies on what MAX_ARRAY_INDEX
is defined as. But instead of MAX_ARRAY_INDEX, the function was hardcoding
MAX_ARRAY_INDEX + 1.

* runtime/Identifier.h:
(JSC::isIndex):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (266212 => 266213)


--- trunk/Source/_javascript_Core/ChangeLog	2020-08-27 01:26:24 UTC (rev 266212)
+++ trunk/Source/_javascript_Core/ChangeLog	2020-08-27 01:47:20 UTC (rev 266213)
@@ -1,3 +1,17 @@
+2020-08-26  Saam Barati  <[email protected]>
+
+        Make isIndex use MAX_ARRAY_INDEX
+        https://bugs.webkit.org/show_bug.cgi?id=215872
+
+        Reviewed by Darin Adler.
+
+        It's already written in such a way where it relies on what MAX_ARRAY_INDEX
+        is defined as. But instead of MAX_ARRAY_INDEX, the function was hardcoding
+        MAX_ARRAY_INDEX + 1.
+
+        * runtime/Identifier.h:
+        (JSC::isIndex):
+
 2020-08-26  Alexey Shvayka  <[email protected]>
 
         Use unsigned type for `length` of JSFunction

Modified: trunk/Source/_javascript_Core/runtime/Identifier.h (266212 => 266213)


--- trunk/Source/_javascript_Core/runtime/Identifier.h	2020-08-27 01:26:24 UTC (rev 266212)
+++ trunk/Source/_javascript_Core/runtime/Identifier.h	2020-08-27 01:47:20 UTC (rev 266213)
@@ -20,6 +20,7 @@
 
 #pragma once
 
+#include "ArrayConventions.h"
 #include "PrivateName.h"
 #include "VM.h"
 #include <wtf/Optional.h>
@@ -33,7 +34,7 @@
 
 ALWAYS_INLINE bool isIndex(uint32_t index)
 {
-    return index != 0xFFFFFFFFU;
+    return index <= MAX_ARRAY_INDEX;
 }
 
 template <typename CharType>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to