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

Implement returning option/result of a handle in code generation #1121

Merged
merged 2 commits into from Jul 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions crates/wit-parser/src/abi.rs
Expand Up @@ -1659,7 +1659,7 @@ impl<'a, B: Bindgen> Generator<'a, B> {
TypeDefKind::Type(t) => self.write_to_memory(t, addr, offset),
TypeDefKind::List(_) => self.write_list_to_memory(ty, addr, offset),

TypeDefKind::Handle(_) => todo!(),
TypeDefKind::Handle(_) => self.lower_and_emit(ty, addr, &I32Store { offset }),

// Decompose the record into its components and then write all
// the components into memory one-by-one.
Expand Down Expand Up @@ -1863,9 +1863,7 @@ impl<'a, B: Bindgen> Generator<'a, B> {

TypeDefKind::List(_) => self.read_list_from_memory(ty, addr, offset),

TypeDefKind::Handle(_) => {
todo!();
}
TypeDefKind::Handle(_) => self.emit_and_lift(ty, addr, &I32Load { offset }),

TypeDefKind::Resource => {
todo!();
Expand Down