diff --git a/crates/cpp/src/lib.rs b/crates/cpp/src/lib.rs index 8b0039710..c1679694a 100644 --- a/crates/cpp/src/lib.rs +++ b/crates/cpp/src/lib.rs @@ -2644,8 +2644,8 @@ impl<'a, 'b> Bindgen for FunctionBindgen<'a, 'b> { abi::Instruction::F32Load { offset } => self.load("float", *offset, operands, results), abi::Instruction::F64Load { offset } => self.load("double", *offset, operands, results), abi::Instruction::I32Store { offset } => self.store("int32_t", *offset, operands), - abi::Instruction::I32Store8 { offset } => self.store("int32_t", *offset, operands), - abi::Instruction::I32Store16 { offset } => self.store("int32_t", *offset, operands), + abi::Instruction::I32Store8 { offset } => self.store("int8_t", *offset, operands), + abi::Instruction::I32Store16 { offset } => self.store("int16_t", *offset, operands), abi::Instruction::I64Store { offset } => self.store("int64_t", *offset, operands), abi::Instruction::F32Store { offset } => self.store("float", *offset, operands), abi::Instruction::F64Store { offset } => self.store("double", *offset, operands), diff --git a/crates/cpp/tests/smoke_details/result8.wit b/crates/cpp/tests/smoke_details/result8.wit new file mode 100644 index 000000000..3ece74f19 --- /dev/null +++ b/crates/cpp/tests/smoke_details/result8.wit @@ -0,0 +1,9 @@ +package test:test; + +interface a { + f: func() -> result<_, u8>; +} + +world result8 { + export a; +}