Skip to content

Conversation

@boingoing
Copy link
Contributor

Turns out it's pretty easy to make the length property of a TypedArray greater than Uint32Max. Passing a TypedArray object like that to Array#reverse hits an assert verifying the length is <= Uint32Max.

This is a valid situation to get into, though, so instead of asserting we should fall into the object (non-Array, non-TypedArray) case and use the slow path which supports larger lengths.

Fixes #6179

@akroshg
Copy link
Contributor

akroshg commented Jun 27, 2019

Nice set of test-cases. Did you verify that there are not other places for typed array that we have same problem about maxlength?
LGTM

Turns out it's pretty easy to make the length property of a TypedArray greater than Uint32Max. Passing a TypedArray object like that to Array#reverse hits an assert verifying the length is <= Uint32Max.

This is a valid situation to get into, though, so instead of asserting we should fall into the object (non-Array, non-TypedArray) case and use the slow path which supports larger lengths.

Fixes chakra-core#6179
@boingoing
Copy link
Contributor Author

@akroshg Took a look at the other Array prototype methods and appears we're doing the right thing with objects of this shape.

@chakrabot chakrabot merged commit d404837 into chakra-core:master Jul 2, 2019
chakrabot pushed a commit that referenced this pull request Jul 2, 2019
… length > Uint32Max

Merge pull request #6184 from boingoing:6179

Turns out it's pretty easy to make the length property of a TypedArray greater than Uint32Max. Passing a TypedArray object like that to Array#reverse hits an assert verifying the length is <= Uint32Max.

This is a valid situation to get into, though, so instead of asserting we should fall into the object (non-Array, non-TypedArray) case and use the slow path which supports larger lengths.

Fixes #6179
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Assertion Failure in JavascriptArray

4 participants