Skip to content

Commit

Permalink
Fix base case for wit-parser's variant alignment (#951)
Browse files Browse the repository at this point in the history
* Fix base case for wit-parser's variant alignment

This fixes a bug in #948 discovered by wit-bindgen's test suite which I
forgot to run prior to landing it here. Historically much of the ABI
code in `wit-parser` was tested by `wit-bindgen` but after the
extraction there is no testing of it in this repository, so this is
something we'll want to improve in the future.

This commit additionally includes a minor version bump for the
wit-parser crate.

* Bump wit-parser's version
  • Loading branch information
alexcrichton committed Mar 6, 2023
1 parent 1d75a98 commit 861bfaa
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wasm-tools"
version = "1.0.26"
version = "1.0.27"
authors = ["The Wasmtime Project Developers"]
edition.workspace = true
description = "CLI tools for interoperating with WebAssembly files"
Expand Down Expand Up @@ -52,8 +52,8 @@ wasmparser = { version = "0.102.0", path = "crates/wasmparser" }
wasmprinter = { version = "0.2.53", path = "crates/wasmprinter" }
wast = { version = "55.0.0", path = "crates/wast" }
wat = { version = "1.0.61", path = "crates/wat" }
wit-component = { version = "0.7.2", path = "crates/wit-component" }
wit-parser = { version = "0.6.3", path = "crates/wit-parser" }
wit-component = { version = "0.7.3", path = "crates/wit-component" }
wit-parser = { version = "0.6.4", path = "crates/wit-parser" }

[dependencies]
anyhow = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/wit-component/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "wit-component"
authors = ["Peter Huene <peter@huene.dev>"]
version = "0.7.2"
version = "0.7.3"
edition.workspace = true
license = "Apache-2.0 WITH LLVM-exception"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion crates/wit-parser/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "wit-parser"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
version = "0.6.3"
version = "0.6.4"
edition.workspace = true
license = "Apache-2.0 WITH LLVM-exception"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion crates/wit-parser/src/sizealign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl SizeAlign {
) -> (usize, usize) {
let (discrim_size, discrim_align) = int_size_align(tag);
let mut case_size = 0;
let mut case_align = 0;
let mut case_align = 1;
for ty in types {
if let Some(ty) = ty {
case_size = case_size.max(self.size(ty));
Expand Down

0 comments on commit 861bfaa

Please sign in to comment.