mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 16:21:11 +00:00
fix str and list layout in refcount proc generation
This commit is contained in:
parent
456d8ff9cb
commit
203bbca185
1 changed files with 4 additions and 3 deletions
|
@ -346,12 +346,13 @@ fn refcount_str<'a>(
|
||||||
) -> Stmt<'a> {
|
) -> Stmt<'a> {
|
||||||
let string = Symbol::ARG_1;
|
let string = Symbol::ARG_1;
|
||||||
let layout_isize = root.layout_isize;
|
let layout_isize = root.layout_isize;
|
||||||
|
let field_layouts = root.arena.alloc([LAYOUT_PTR, layout_isize, layout_isize]);
|
||||||
|
|
||||||
// Get the last word as a signed int
|
// Get the last word as a signed int
|
||||||
let last_word = root.create_symbol(ident_ids, "last_word");
|
let last_word = root.create_symbol(ident_ids, "last_word");
|
||||||
let last_word_expr = Expr::StructAtIndex {
|
let last_word_expr = Expr::StructAtIndex {
|
||||||
index: 2,
|
index: 2,
|
||||||
field_layouts: root.arena.alloc([LAYOUT_PTR, layout_isize]),
|
field_layouts,
|
||||||
structure: string,
|
structure: string,
|
||||||
};
|
};
|
||||||
let last_word_stmt = |next| Stmt::Let(last_word, last_word_expr, layout_isize, next);
|
let last_word_stmt = |next| Stmt::Let(last_word, last_word_expr, layout_isize, next);
|
||||||
|
@ -377,7 +378,7 @@ fn refcount_str<'a>(
|
||||||
let elements = root.create_symbol(ident_ids, "elements");
|
let elements = root.create_symbol(ident_ids, "elements");
|
||||||
let elements_expr = Expr::StructAtIndex {
|
let elements_expr = Expr::StructAtIndex {
|
||||||
index: 0,
|
index: 0,
|
||||||
field_layouts: root.arena.alloc([LAYOUT_PTR, layout_isize]),
|
field_layouts,
|
||||||
structure: string,
|
structure: string,
|
||||||
};
|
};
|
||||||
let elements_stmt = |next| Stmt::Let(elements, elements_expr, layout_isize, next);
|
let elements_stmt = |next| Stmt::Let(elements, elements_expr, layout_isize, next);
|
||||||
|
@ -478,7 +479,7 @@ fn refcount_list<'a>(
|
||||||
let elements = root.create_symbol(ident_ids, "elements");
|
let elements = root.create_symbol(ident_ids, "elements");
|
||||||
let elements_expr = Expr::StructAtIndex {
|
let elements_expr = Expr::StructAtIndex {
|
||||||
index: 0,
|
index: 0,
|
||||||
field_layouts: arena.alloc([box_layout, layout_isize]),
|
field_layouts: arena.alloc([box_layout, layout_isize, layout_isize]),
|
||||||
structure,
|
structure,
|
||||||
};
|
};
|
||||||
let elements_stmt = |next| Stmt::Let(elements, elements_expr, box_layout, next);
|
let elements_stmt = |next| Stmt::Let(elements, elements_expr, box_layout, next);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue