diff --git a/compiler/gen_llvm/src/llvm/build.rs b/compiler/gen_llvm/src/llvm/build.rs index b062d2d125..3ae6ed6e1c 100644 --- a/compiler/gen_llvm/src/llvm/build.rs +++ b/compiler/gen_llvm/src/llvm/build.rs @@ -1198,13 +1198,14 @@ pub fn build_exp_expr<'a, 'ctx, 'env>( let tag_id_type = basic_type_from_layout(env, &union_layout.tag_id_layout()).into_int_type(); + let ptr = tag_pointer_clear_tag_id(env, argument.into_pointer_value()); lookup_at_index_ptr2( env, tag_id_type, union_layout, field_layouts, *index as usize, - argument.into_pointer_value(), + ptr, ) } UnionLayout::NullableUnwrapped { diff --git a/compiler/gen_llvm/src/llvm/convert.rs b/compiler/gen_llvm/src/llvm/convert.rs index 88e1808ec8..729c118626 100644 --- a/compiler/gen_llvm/src/llvm/convert.rs +++ b/compiler/gen_llvm/src/llvm/convert.rs @@ -19,9 +19,6 @@ fn basic_type_from_record<'a, 'ctx, 'env>( .as_basic_type_enum() } -//pub const fn store_tag_id_in_pointer<'a, 'ctx, 'env>( -// env: &crate::llvm::build::Env<'a, 'ctx, 'env>, - pub fn basic_type_from_layout<'a, 'ctx, 'env>( env: &crate::llvm::build::Env<'a, 'ctx, 'env>, layout: &Layout<'_>, diff --git a/compiler/load/src/file.rs b/compiler/load/src/file.rs index bc70105ff6..fd8fd1dc4b 100644 --- a/compiler/load/src/file.rs +++ b/compiler/load/src/file.rs @@ -2077,7 +2077,7 @@ fn update<'a>( &mut state.procedures, ); - // Proc::insert_refcount_operations(arena, &mut state.procedures); + Proc::insert_refcount_operations(arena, &mut state.procedures); // display the mono IR of the module, for debug purposes if roc_mono::ir::PRETTY_PRINT_IR_SYMBOLS {