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

wasm::is{U,S}Integer64() doesn't work well around INT64_MAX #2291

Open
tzik opened this issue Aug 8, 2019 · 0 comments · May be fixed by #2314
Open

wasm::is{U,S}Integer64() doesn't work well around INT64_MAX #2291

tzik opened this issue Aug 8, 2019 · 0 comments · May be fixed by #2314

Comments

@tzik
Copy link
Contributor

tzik commented Aug 8, 2019

The latest clang points a minor bug for -Wimplicit-int-float-conversion.

On the implementation of wasm::wasm::isUInteger64, std::numeric_limits<uint64_t>::max() is implicitly converted to double.
As double has only 53 bit for digits on typical systems, and the conversion rounds the value to 0x1p64 rather than 0x1p64 - 1, that implies isUInteger64(0x1p64) returns true, which is wrong.

We should probably use fixed double literals like 0x1p64, -0x1p63, and 0x1p63 for the boundary check here.

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