From a70924b81b2df8c46d57f80d220a6afc55451e4f Mon Sep 17 00:00:00 2001 From: Edgar Luque Date: Tue, 12 Mar 2024 12:08:02 +0100 Subject: [PATCH] fix --- lib/edlang_codegen_llvm/src/codegen.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/edlang_codegen_llvm/src/codegen.rs b/lib/edlang_codegen_llvm/src/codegen.rs index 6bdd070db..9b2839c96 100644 --- a/lib/edlang_codegen_llvm/src/codegen.rs +++ b/lib/edlang_codegen_llvm/src/codegen.rs @@ -992,15 +992,15 @@ fn compile_rvalue<'ctx>( for proj in &place.projection { match proj { ir::PlaceElem::Deref => { - ptr = ctx - .builder - .build_load(compile_basic_type(ctx, &local_ty), ptr, "deref")? - .into_pointer_value(); local_ty = match local_ty.kind { ir::TypeKind::Ptr(_, inner) => *inner, ir::TypeKind::Ref(_, inner) => *inner, _ => unreachable!(), - } + }; + ptr = ctx + .builder + .build_load(compile_basic_type(ctx, &local_ty), ptr, "deref")? + .into_pointer_value(); } ir::PlaceElem::Field { .. } => todo!(), ir::PlaceElem::Index { .. } => todo!(),