Skip to content

Commit

Permalink
Add the element type to Instruction::IterElem (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
fitzgen committed Aug 30, 2021
1 parent fb9ac9e commit aeec84a
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion crates/gen-c/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1652,7 +1652,7 @@ impl Bindgen for FunctionBindgen<'_> {
list_name, elem_name, operands[0], operands[1]
));
}
Instruction::IterElem => results.push("e".to_string()),
Instruction::IterElem { .. } => results.push("e".to_string()),
Instruction::IterBasePointer => results.push("base".to_string()),

Instruction::BufferLowerPtrLen { .. } => {
Expand Down
2 changes: 1 addition & 1 deletion crates/gen-js/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1665,7 +1665,7 @@ impl Bindgen for FunctionBindgen<'_> {
}
}

Instruction::IterElem => results.push("e".to_string()),
Instruction::IterElem { .. } => results.push("e".to_string()),

Instruction::IterBasePointer => results.push("base".to_string()),

Expand Down
2 changes: 1 addition & 1 deletion crates/gen-rust-wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,7 @@ impl Bindgen for FunctionBindgen<'_> {
));
}

Instruction::IterElem => results.push("e".to_string()),
Instruction::IterElem { .. } => results.push("e".to_string()),

Instruction::IterBasePointer => results.push("base".to_string()),

Expand Down
2 changes: 1 addition & 1 deletion crates/gen-wasmtime-py/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1965,7 +1965,7 @@ impl Bindgen for FunctionBindgen<'_> {
results.push(result);
}

Instruction::IterElem => {
Instruction::IterElem { .. } => {
let name = self.locals.tmp("e");
results.push(name.clone());
self.payloads.push(name);
Expand Down
2 changes: 1 addition & 1 deletion crates/gen-wasmtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1968,7 +1968,7 @@ impl Bindgen for FunctionBindgen<'_> {
}
}

Instruction::IterElem => results.push("e".to_string()),
Instruction::IterElem { .. } => results.push("e".to_string()),

Instruction::IterBasePointer => results.push("base".to_string()),

Expand Down
4 changes: 2 additions & 2 deletions crates/witx2/src/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ def_instruction! {
/// each iteration of the list.
///
/// This is only used inside of blocks related to lowering lists.
IterElem : [0] => [1],
IterElem { element: &'a Type } : [0] => [1],

/// Pushes an operand onto the stack representing the base pointer of
/// the next element in a list.
Expand Down Expand Up @@ -1485,7 +1485,7 @@ impl<'a, B: Bindgen> Generator<'a, B> {
self.emit(&ListCanonLower { element, realloc });
} else {
self.push_block();
self.emit(&IterElem);
self.emit(&IterElem { element });
self.emit(&IterBasePointer);
let addr = self.stack.pop().unwrap();
self.write_to_memory(element, addr, 0);
Expand Down

0 comments on commit aeec84a

Please sign in to comment.