-
Notifications
You must be signed in to change notification settings - Fork 3.4k
EMULATED_FUNCTION_POINTERS=1 issue with EH and functions returning int64 #7399
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
Comments
I can confirm this issue. What happens is we need to do a call to a function type that is not valid in JS, so we need to legalize it. We legalize imports and exports properly, but the invoke/dynCall logic is somewhat special and I guess we need to fix something there. Also confirming that this should only affect code using exceptions or setjmp, where an invoke ends up necessary to a function type containing an i64. |
Can confirm this issue as well. In my own code I can work around it by marking functions like |
…d function pointer mode correctly by calling the ftCall_helper_<sig> functions exported by the wasm mode. Part of the fix for: emscripten-core#7399
Submitted two 2 PRs to fastcomp/emscripten with a possible fix. |
…invokes with non-legal signatures work. Fixes emscripten-core#7399.
* [wasm] Add the fix for emscripten-core/emscripten#7399 as a patch for emscripten. * [wasm] Factor out some flags from the makefile targets. * [wasm] Enable EMULATED_FUNCTION_POINTERS.
The sample doesn't look legal, but that may be besides the point. |
Could anyone please suggest a temporary workaround for this issue? I'm in a scenario where both Unfortunately, my codebase is plain C, and I'm unable to set C++11 attributes such as |
I think this is almost fixed - we legalize invokes now, and #8065 should fix emulated function pointers as well - may be interesting to test your code with that PR. |
The testcase above seems to work now. |
This is now fixed. Thanks. |
Testcase:
Compile with:
Expected result:
Actual result:
The text was updated successfully, but these errors were encountered: