-
Notifications
You must be signed in to change notification settings - Fork 683
Fix count variable calculation in typedarray copyWithin #3158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
d5d248d
to
52d9e20
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the correct fix for the issue, the problem is not the size of the allocation. The issue is that the number of elements that should be copied is incorrectly calculated in the copyWithin method. All of these variables should be uint32_t
and should be moved into the else block, where the bounds are checked.
3d3409a
to
91af0fd
Compare
3c46d52
to
5bb3f0f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, please rebase.
Fixes jerryscript-project#3130 JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the related regression tests as well.
I cant put the test case anywhere because if i put it into the fails folder, it passes beacuse of the system allocator, and if i put it into the es2015 folder, it fails, beacuse we dont have enough memory. |
I see, now it's ready to go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #3130
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu