mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
wasm: store tag id right after the content
This commit is contained in:
parent
620d719661
commit
d1f7b0fc5a
3 changed files with 21 additions and 17 deletions
|
@ -1595,7 +1595,8 @@ impl<'a> WasmBackend<'a> {
|
|||
|
||||
// Store the tag ID (if any)
|
||||
if stores_tag_id_as_data {
|
||||
let id_offset = data_offset + data_size - data_alignment;
|
||||
let id_offset =
|
||||
data_offset + union_layout.data_size_without_tag_id(TARGET_INFO).unwrap();
|
||||
|
||||
let id_align = union_layout.tag_id_builtin().alignment_bytes(TARGET_INFO);
|
||||
let id_align = Align::from(id_align);
|
||||
|
@ -1678,8 +1679,7 @@ impl<'a> WasmBackend<'a> {
|
|||
};
|
||||
|
||||
if union_layout.stores_tag_id_as_data(TARGET_INFO) {
|
||||
let (data_size, data_alignment) = union_layout.data_size_and_alignment(TARGET_INFO);
|
||||
let id_offset = data_size - data_alignment;
|
||||
let id_offset = union_layout.data_size_without_tag_id(TARGET_INFO).unwrap();
|
||||
|
||||
let id_align = union_layout.tag_id_builtin().alignment_bytes(TARGET_INFO);
|
||||
let id_align = Align::from(id_align);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue