Bug 185495
| Summary: | ArraySpeciesCreate not checking for max length on array like objects | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Leo Balter <leo> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | ysuzuki |
| Priority: | P2 | ||
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=185476 | ||
Leo Balter
I got a false positive from the test runner while working on Bug 185476. While the fix there is still fine, it doesn't solve the whole problem where a RangeError is not observed for non-array objects with the length property set to values > 2**32-1.
`constructArrayWithSizeQuirk` in the Source/JavaScriptCore/runtime/ArrayConstructor.cpp file has a check for the length - code below - but I was unable to reach it. My first patch was calling it but it's still not successful.
```
uint32_t n = length.toUInt32(exec);
if (n != length.toNumber(exec))
return throwException(exec, scope, createRangeError(exec, ASCIILiteral("Array size is not a small enough positive integer.")));
```
Yusuke, would you help me here, please?
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |