Skip to content
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

An issue about length of TypedArray #708

Closed
NWU-NISL opened this issue Jun 10, 2020 · 1 comment · Fixed by #714
Closed

An issue about length of TypedArray #708

NWU-NISL opened this issue Jun 10, 2020 · 1 comment · Fixed by #714

Comments

@NWU-NISL
Copy link

According to ES10.0,TypedArray(length) uses method ToIndex to avoid negative length. So the length of the array can not be negative. But when the parameter of Float64Array is -268435457 or smaller, the length of array is changed into a negative number. And other TypedArray constructors also have similar situation. Rhino achieves TypedArray(length) but doesn't handle negative length properly. This may be an issue of TypedArray constructors' parameter judgment.

version

1.7.12

command

java -jar rhino/rhino-1.7.12.jar -debug -version 200 testcase.js

testcase

var NISLFuzzingFunc = function(){
	var array = new Float64Array(-268435457);
        print(array.length);
};
NISLFuzzingFunc();

output

-268435457

expected output

RangeError:Negative array length

Contributor:@YuanWangC

@rbri
Copy link
Collaborator

rbri commented Jun 10, 2020 via email

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 a pull request may close this issue.

2 participants