mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
don't doubly allocate
This commit is contained in:
parent
63fd71ba6e
commit
47128414d4
1 changed files with 3 additions and 2 deletions
|
@ -1067,11 +1067,12 @@ pub fn build_exp_expr<'a, 'ctx, 'env>(
|
|||
field_types.push(field_type);
|
||||
|
||||
if let Layout::RecursivePointer = tag_field_layout {
|
||||
let ptr = allocate_with_refcount(env, &tag_layout, val);
|
||||
debug_assert!(val.is_pointer_value());
|
||||
|
||||
// we store recursive pointers as `i64*`
|
||||
let ptr = cast_basic_basic(
|
||||
builder,
|
||||
ptr.into(),
|
||||
val,
|
||||
ctx.i64_type().ptr_type(AddressSpace::Generic).into(),
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue