components: Fix support for 0-sized flags (#4560)

This commit goes through and updates support in the various argument
passing routines to support 0-sized flags. A bit of a degenerate case
but clarified in WebAssembly/component-model#76 as intentional.
This commit is contained in:
Alex Crichton
2022-08-01 11:05:09 -05:00
committed by GitHub
parent 05e6abf2f6
commit 893fadb485
9 changed files with 59 additions and 9 deletions

View File

@@ -53,10 +53,8 @@ enum ValType {
Float64,
Char,
Record(Vec<ValType>),
// FIXME(WebAssembly/component-model#75) are zero-sized flags allowed?
//
// ... otherwise go up to 65 flags to exercise up to 3 u32 values
Flags(UsizeInRange<1, 65>),
// Up to 65 flags to exercise up to 3 u32 values
Flags(UsizeInRange<0, 65>),
Tuple(Vec<ValType>),
Variant(NonZeroLenVec<ValType>),
Union(NonZeroLenVec<ValType>),