Skip to content

Commit 823efcb

Browse files
authored
Solve the future/errror binary spec discrepancy, fixes #2044 (#2045)
1 parent 1f19d96 commit 823efcb

File tree

2 files changed

+4
-4
lines changed
  • crates

2 files changed

+4
-4
lines changed

crates/wasm-encoder/src/component/types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ impl ComponentDefinedTypeEncoder<'_> {
675675

676676
/// Define a `future` type with the specified payload.
677677
pub fn future(self, payload: Option<ComponentValType>) {
678-
self.0.push(0x67);
678+
self.0.push(0x65);
679679
payload.encode(self.0);
680680
}
681681

@@ -687,7 +687,7 @@ impl ComponentDefinedTypeEncoder<'_> {
687687

688688
/// Define the `error-context` type.
689689
pub fn error_context(self) {
690-
self.0.push(0x65);
690+
self.0.push(0x64);
691691
}
692692
}
693693

crates/wasmparser/src/readers/component/types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,9 +550,9 @@ impl<'a> ComponentDefinedType<'a> {
550550
},
551551
0x69 => ComponentDefinedType::Own(reader.read()?),
552552
0x68 => ComponentDefinedType::Borrow(reader.read()?),
553-
0x67 => ComponentDefinedType::Future(reader.read()?),
553+
0x65 => ComponentDefinedType::Future(reader.read()?),
554554
0x66 => ComponentDefinedType::Stream(reader.read()?),
555-
0x65 => ComponentDefinedType::ErrorContext,
555+
0x64 => ComponentDefinedType::ErrorContext,
556556
x => return reader.invalid_leading_byte(x, "component defined type"),
557557
})
558558
}

0 commit comments

Comments
 (0)