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

The MIN_INT{8,16,32,53} is incorrect when compile with -sASSERTIONS=2 #21089

Open
toyobayashi opened this issue Jan 16, 2024 · 2 comments
Open

Comments

@toyobayashi
Copy link
Contributor

toyobayashi commented Jan 16, 2024

Please include the following in your bug report:

Version of emscripten/emsdk:

emcc -v
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.48 (e967e20b4727956a30592165a3c1cde5c67fa0a8)
clang version 18.0.0 (https://github.com/llvm/llvm-project a54545ba6514802178cf7cf1c1dd9f7efbf3cde7)
Target: wasm32-unknown-emscripten
Thread model: posix
Aborted(Assertion failed: value (-2147483648) too small to write as 32-bit value)
RuntimeError: Aborted(Assertion failed: value (-2147483648) too small to write as 32-bit value)

var MIN_INT8 = - (2 ** ( 8 - 1)) + 1;
var MIN_INT16 = - (2 ** (16 - 1)) + 1;
var MIN_INT32 = - (2 ** (32 - 1)) + 1;
var MIN_INT53 = - (2 ** (53 - 1)) + 1;
var MIN_INT64 = - (2 ** (64 - 1)) + 1;

Should have no + 1 here?

@kripken
Copy link
Member

kripken commented Jan 17, 2024

Yes, those +1s look wrong.

Looks like @sbc100 you added that in #19251 - are we missing something, or are those MIN constants off by one?

@sbc100
Copy link
Collaborator

sbc100 commented Jan 17, 2024

I agree, it looks like the +1 there is wrong.

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

No branches or pull requests

3 participants