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

Possible bug? #7

Closed
CarterLi opened this issue Dec 22, 2017 · 1 comment
Closed

Possible bug? #7

CarterLi opened this issue Dec 22, 2017 · 1 comment

Comments

@CarterLi
Copy link

let _checkParameters = function (sab, loc, truth, who) {
    if (!(sab instanceof SharedArrayBuffer &&
	  loc|0 == loc &&
	  loc >= 0 &&
	  loc % truth.ALIGN == 0 &&
	  loc + truth.NUMBYTES <= sab.byteLength))
    {
	throw new Error("Bad arguments to " + who + ": " + sab + " " + loc);
    }
}

== has a higher priority then |. Thus loc|0 == loc means loc | (0 == loc), which is always non-zero ( effectively true )

@lars-t-hansen
Copy link
Contributor

Thank you, will fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants