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

Support reference types in Func::wrap #1991

Merged
merged 6 commits into from
Jul 7, 2020

Conversation

fitzgen
Copy link
Member

@fitzgen fitzgen commented Jul 7, 2020

No description provided.

@fitzgen fitzgen requested a review from alexcrichton July 7, 2020 18:10
@fitzgen fitzgen changed the title Support reference types inFunc::wrap Support reference types in Func::wrap Jul 7, 2020
@github-actions github-actions bot added the wasmtime:api Related to the API of the `wasmtime` crate itself label Jul 7, 2020
Copy link
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

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

Nice! This all looks pretty good to me, but I think that we still need to do checks for cross-store-ness and bad results there.

I think that we're guaranteed that the arguments will come from the same store (since they come from compiled code), but when the closure returns a value we need to guarantee that the return value comes from the same store as the function iteslf.

@github-actions
Copy link

github-actions bot commented Jul 7, 2020

Subscribe to Label Action

cc @peterhuene

This issue or pull request has been labeled: "wasmtime:api"

Thus the following users have been cc'd because of the following labels:

  • peterhuene: wasmtime:api

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

@fitzgen
Copy link
Member Author

fitzgen commented Jul 7, 2020

Cross-store checks added, as well as tests for that, and documentation for the newly supported types.

Copy link
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

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

👍

I forgot about one other case (using get* functions) where we need to check for cross-store-ness, but otherwise lgtm

crates/wasmtime/src/func.rs Outdated Show resolved Hide resolved
@fitzgen fitzgen merged commit 2a4f72a into bytecodealliance:main Jul 7, 2020
@fitzgen fitzgen deleted the func-wrap-and-ref-types branch July 7, 2020 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasmtime:api Related to the API of the `wasmtime` crate itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants