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

feat(c-api) Correctly implement “trap” in wasm_func_new* #1751

Merged
merged 2 commits into from
Oct 26, 2020

Conversation

Hywan
Copy link
Contributor

@Hywan Hywan commented Oct 22, 2020

The implementation of “trap” in wasm_func_new was “incorrect”. It's
more idiomatic to return a RuntimeError than raising it in this
case, so that we don't duplicate locations where runtime errors are
raised.

The implementation of “trap” in wasm_func_new_with_env was
missing. This patch implements a similar strategy than the sibling
function.

Fixes #1744.

The implementation of “trap” in `wasm_func_new` was “incorrect”. It's
more idiomatic to return a `RuntimeError` than raising it in this
case, so that we don't duplicate locations where runtime errors are
raised.

The implementation of “trap” in `wasm_func_new_with_env` was
missing. This patch implements a similar strategy than the sibling
function.
@Hywan Hywan added bug Something isn't working 🎉 enhancement New feature! 📦 lib-c-api About wasmer-c-api labels Oct 22, 2020
@Hywan Hywan self-assigned this Oct 22, 2020
Hywan added a commit to Hywan/go-ext-wasm that referenced this pull request Oct 22, 2020
@Hywan
Copy link
Contributor Author

Hywan commented Oct 26, 2020

bors r+

@bors
Copy link
Contributor

bors bot commented Oct 26, 2020

@bors bors bot merged commit c6978ea into wasmerio:master Oct 26, 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 🎉 enhancement New feature! 📦 lib-c-api About wasmer-c-api
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How do traps work in the C API?
2 participants