From e13ea550044f9288be469cc1a33a7d57bc0b264d Mon Sep 17 00:00:00 2001 From: Folkert Date: Sat, 26 Mar 2022 17:56:36 +0100 Subject: [PATCH] use roc_load_value to move a value to the stack --- compiler/gen_llvm/src/llvm/refcounting.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/gen_llvm/src/llvm/refcounting.rs b/compiler/gen_llvm/src/llvm/refcounting.rs index 0098432aa5..e42414279d 100644 --- a/compiler/gen_llvm/src/llvm/refcounting.rs +++ b/compiler/gen_llvm/src/llvm/refcounting.rs @@ -20,6 +20,7 @@ use roc_module::symbol::Symbol; use roc_mono::layout::{Builtin, Layout, LayoutIds, UnionLayout}; use roc_target::TargetInfo; +use super::build::load_roc_value; use super::convert::{argument_type_from_layout, argument_type_from_union_layout}; /// "Infinite" reference count, for static values @@ -1434,9 +1435,8 @@ fn build_rec_union_recursive_decrement<'a, 'ctx, 'env>( .build_struct_gep(struct_ptr, i as u32, "gep_recursive_pointer") .unwrap(); - let field = env - .builder - .build_load(elem_pointer, "decrement_struct_field"); + let field = + load_roc_value(env, *field_layout, elem_pointer, "decrement_struct_field"); deferred_nonrec.push((field, field_layout)); }