diff --git a/compiler/gen/src/llvm/build.rs b/compiler/gen/src/llvm/build.rs index c644a75ca5..05dbaa91a3 100644 --- a/compiler/gen/src/llvm/build.rs +++ b/compiler/gen/src/llvm/build.rs @@ -765,7 +765,7 @@ 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).into(); + let ptr = allocate_with_refcount(env, &tag_layout, val); builder.build_store(ptr, val); diff --git a/compiler/mono/tests/test_mono.rs b/compiler/mono/tests/test_mono.rs index 006052b4f3..e010927233 100644 --- a/compiler/mono/tests/test_mono.rs +++ b/compiler/mono/tests/test_mono.rs @@ -1850,6 +1850,7 @@ mod test_mono { let Test.2 = S Test.8 Test.9; let Test.5 = 1i64; let Test.6 = Index 0 Test.2; + dec Test.2; let Test.7 = lowlevel Eq Test.5 Test.6; if Test.7 then let Test.3 = 0i64; @@ -1901,12 +1902,15 @@ mod test_mono { let Test.10 = lowlevel Eq Test.8 Test.9; if Test.10 then let Test.4 = Index 1 Test.2; + dec Test.2; let Test.3 = 1i64; ret Test.3; else + dec Test.2; let Test.5 = 0i64; ret Test.5; else + dec Test.2; let Test.6 = 0i64; ret Test.6; "#