Skip to content

Converting certain component types from wasmparser to wasm_encoder #1639

Closed Answered by alexcrichton
thesuhas asked this question in Q&A
Discussion options

You must be logged in to vote

You might be interested in #1628 which just landed. That's only got support for core modules but if you're interested in adding these conversions to wasm-encoder itself that'd be a welcome PR (and would "just" be extending the new Reencode trait). As for your questions:

For wasmparser::HeapType only the Module variant can be converted. The other two variants should trigger a panic or an error. They're transient states during validation and afterwards but will never show up if you're only parsing a component.

For component functions the Unnamed type would map to calling the result method, not results, so you'd basically call one or the other.

This'd definitely make sense to bake straight i…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by thesuhas
Comment options

You must be logged in to vote
1 reply
@alexcrichton
Comment options

Comment options

You must be logged in to vote
3 replies
@alexcrichton
Comment options

@thesuhas
Comment options

@alexcrichton
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants