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

fix(c-api) Register errors from wasm_module_serialize #1715

Merged
merged 3 commits into from
Oct 15, 2020

Conversation

Hywan
Copy link
Contributor

@Hywan Hywan commented Oct 13, 2020

This patch updates wasm_module_serialize to register errors withupdate_last_error if any.

@Hywan Hywan added the bug Something isn't working label Oct 13, 2020
Copy link
Contributor

@MarkMcCaskey MarkMcCaskey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good, perhaps we want to write an "error" value out at out_ptr though, like all 0s.

Currently this can report errors but there's no easy way to check if this function errored because update_last_error is global and could have been set by something else

@Hywan
Copy link
Contributor Author

Hywan commented Oct 15, 2020

Yes I know. The strategy for the other similar API is to keep the out parameter as is. Usually, the user passes a NULL value, so if NULL is still there, it's a sign for an error. The wasm.h doesn't precise anything about such behavior :-/.

@Hywan
Copy link
Contributor Author

Hywan commented Oct 15, 2020

bors r+

@bors
Copy link
Contributor

bors bot commented Oct 15, 2020

@bors bors bot merged commit 193d7c8 into wasmerio:master Oct 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants