Increase FuncCastEmulation NUM_PARAMS - #1884
Conversation
|
Thanks! Looks good. Interesting that Ruby needs more parameters here. Do you happen to know where in the code it depends on Before we merge, have you joined the wasm community group? |
|
Sorry, I didn't see the As for why this is happening, I don't quite know what I'm looking at, but I'll tell you what I do know. Calling
|
|
Hmm, b8395 is probably just the function that throws the error. I think that data is enough - looks like Ruby does the same as Python, and relies on C undefined behavior with function pointer arguments, making this pass necessary. |
|
As this is a small change to a constant, I think we can merge it, but for future contributions it would be important to finish joining the group. |
|
Just stumbled on this PR.
@kripken fyi glib (not glibc) is not great with function pointer casts. Here's a patch I had to apply to avoid function pointer casts back in the asm.js days (emulating function pointer casts increased the output .js size to ~1GB): https://gitlab.com/aidanhs/emwesnoth/-/blob/master/diff-glib.patch I should try to update that repo for wasm... |
|
Thanks @aidanhs , interesting to know it's not just Python here. |
FuncCastEmulationsupports a hardcoded number of parameters:Turns out 15 is not enough for everybody: Ruby 2.6.0 needs
NUM_PARAMS = 16. This patch is necessary to support Ruby 2.6.0 in WebAssembly, and in fact is the only patch needed to make the relevant build process work with an otherwise normalemscriptentoolchain.