wasm: fix WasmLayout for LambdaSet

This commit is contained in:
Brian Carroll 2022-04-03 00:23:32 +01:00
parent a63e55e023
commit ab3a75b754
2 changed files with 6 additions and 5 deletions

View file

@ -86,9 +86,10 @@ impl WasmLayout {
format: StackMemoryFormat::Decimal, format: StackMemoryFormat::Decimal,
}, },
Layout::LambdaSet(lambda_set) => WasmLayout::new(&lambda_set.runtime_representation()),
Layout::Builtin(Str | Dict(_, _) | Set(_) | List(_)) Layout::Builtin(Str | Dict(_, _) | Set(_) | List(_))
| Layout::Struct { .. } | Layout::Struct { .. }
| Layout::LambdaSet(_)
| Layout::Union(NonRecursive(_)) => Self::StackMemory { | Layout::Union(NonRecursive(_)) => Self::StackMemory {
size, size,
alignment_bytes, alignment_bytes,

View file

@ -2660,7 +2660,7 @@ fn pattern_match_unit_tag() {
// see for why this is disabled on wasm32 https://github.com/rtfeldman/roc/issues/1687 // see for why this is disabled on wasm32 https://github.com/rtfeldman/roc/issues/1687
#[cfg(not(feature = "wasm-cli-run"))] #[cfg(not(feature = "wasm-cli-run"))]
#[test] #[test]
#[cfg(any(feature = "gen-llvm"))] #[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn mirror_llvm_alignment_padding() { fn mirror_llvm_alignment_padding() {
// see https://github.com/rtfeldman/roc/issues/1569 // see https://github.com/rtfeldman/roc/issues/1569
assert_evals_to!( assert_evals_to!(
@ -2683,7 +2683,7 @@ fn mirror_llvm_alignment_padding() {
} }
#[test] #[test]
#[cfg(any(feature = "gen-llvm"))] #[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn lambda_set_bool() { fn lambda_set_bool() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
@ -2708,7 +2708,7 @@ fn lambda_set_bool() {
} }
#[test] #[test]
#[cfg(any(feature = "gen-llvm"))] #[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn lambda_set_byte() { fn lambda_set_byte() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
@ -2762,7 +2762,7 @@ fn lambda_set_struct_byte() {
} }
#[test] #[test]
#[cfg(any(feature = "gen-llvm"))] #[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn lambda_set_enum_byte_byte() { fn lambda_set_enum_byte_byte() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(