unwrap lamda set to runtime representation

This commit is contained in:
Folkert 2023-04-23 17:56:23 +02:00
parent 9e2051670f
commit f7e3254a35
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
2 changed files with 17 additions and 8 deletions

View file

@ -654,7 +654,15 @@ impl<
}
let base_offset = self.claim_stack_area(sym, struct_size);
if let Layout::Struct { field_layouts, .. } = layout_interner.get(*layout) {
let mut in_layout = *layout;
let layout = loop {
match layout_interner.get(in_layout) {
Layout::LambdaSet(inner) => in_layout = inner.runtime_representation(),
other => break other,
}
};
if let Layout::Struct { field_layouts, .. } = layout {
let mut current_offset = base_offset;
for (field, field_layout) in fields.iter().zip(field_layouts.iter()) {
self.copy_symbol_to_stack_offset(
@ -669,8 +677,15 @@ impl<
}
} else {
// This is a single element struct. Just copy the single field to the stack.
dbg!(&fields);
debug_assert_eq!(fields.len(), 1);
self.copy_symbol_to_stack_offset(layout_interner, buf, base_offset, &fields[0], layout);
self.copy_symbol_to_stack_offset(
layout_interner,
buf,
base_offset,
&fields[0],
&in_layout,
);
}
}

View file

@ -333,12 +333,6 @@ trait Backend<'a> {
ret_layout,
..
} => {
dbg!(
func_sym,
func_sym.name() == Symbol::BOOL_TRUE,
func_sym.name().is_builtin()
);
if let LowLevelWrapperType::CanBeReplacedBy(lowlevel) =
LowLevelWrapperType::from_symbol(func_sym.name())
{