mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
fix stack size of empty tag union
This commit is contained in:
parent
aa08256aef
commit
c09cb4e3ea
5 changed files with 112 additions and 85 deletions
|
@ -238,16 +238,12 @@ fn tag_id_from_data<'a, M: ReplAppMemory>(
|
|||
.unwrap();
|
||||
let tag_id_addr = data_addr + offset as usize;
|
||||
|
||||
match union_layout.tag_id_builtin() {
|
||||
Builtin::Bool => mem.deref_bool(tag_id_addr) as i64,
|
||||
Builtin::Int(IntWidth::U8) => mem.deref_u8(tag_id_addr) as i64,
|
||||
Builtin::Int(IntWidth::U16) => mem.deref_u16(tag_id_addr) as i64,
|
||||
Builtin::Int(IntWidth::U64) => {
|
||||
// used by non-recursive unions at the
|
||||
// moment, remove if that is no longer the case
|
||||
mem.deref_i64(tag_id_addr)
|
||||
}
|
||||
_ => unreachable!("invalid tag id layout"),
|
||||
use roc_mono::layout::Discriminant::*;
|
||||
match union_layout.discriminant() {
|
||||
U0 => 0,
|
||||
U1 => mem.deref_bool(tag_id_addr) as i64,
|
||||
U8 => mem.deref_u8(tag_id_addr) as i64,
|
||||
U16 => mem.deref_u16(tag_id_addr) as i64,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue