-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Add test for EM_JS and i64 arguments #15916
Conversation
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.
It looks like we have other.test_EM_ASM_i64
which checks that this fails (without WASM_BIGINT
). Maybe this PR can add to that test, or otherwise keep the two things close together?
Btw, that test shows that we fail to compile with EM_ASM. I wasn't aware that EM_ASM and EM_JS differed there...
c24adde
to
3f0f6e7
Compare
Added a check and error |
It makes sense to me to (a) have this test in core since it effect the JS/wasm boundary and (b) grouping em_js tests together makes sense to me. |
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.
Am I correct that EM_JS with i64 never worked, because while in theory the JS side could have two i32 params (the legalized i64), there is a single place defining the function for both JS and C, so the C would not have an i64 in that case? So writing an i64 there would not be possible with JS getting two legalized parameters. (Just checking this new error does not prevent anything that worked before.)
Yes, you are mostly correct in your assessment I believe. Using int64 with EM_JS results in the JS signature that doesn't match the one used in C, or that one called at runtime. However its conceivable that you could ignore the JS arguments that instead just peek into I do plan to make this work in the long run.. so perhaps I should just make this into a warning rather than an error for now? |
I went with the warning instead.. |
5c2f79e
to
5437421
Compare
Ideally we should error out if WASM_BIGINT is not passed by I have yet to find a good place to do that. See #15871
See #15871