From 94a859538cb68805d183b4d92e6bb2adaee96f42 Mon Sep 17 00:00:00 2001 From: William Moses Date: Mon, 23 Dec 2024 22:50:57 -0500 Subject: [PATCH] Update compiler.jl --- src/compiler.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/compiler.jl b/src/compiler.jl index a0109a0f51..ac52427659 100644 --- a/src/compiler.jl +++ b/src/compiler.jl @@ -647,8 +647,10 @@ function create_recursive_stores(B::LLVM.IRBuilder, @nospecialize(Ty::DataType), if fallback zeroAll = false - prev = bitcast!(B, prev, LLVM.PointerType(T_prjlvalue, addrspace(value_type(prev3)))) - prev = addrspacecast!(B, prev, LLVM.PointerType(T_prjlvalue, Derived)) + prev3 = bitcast!(B, prev3, LLVM.PointerType(T_prjlvalue, addrspace(value_type(prev3)))) + if addrspace(value_type(prev3)) != Derived + prev3 = addrspacecast!(B, prev3, LLVM.PointerType(T_prjlvalue, Derived)) + end zero_single_allocation(B, Ty, T_prjlvalue, prev, zeroAll, LLVM.ConstantInt(T_int64, 0); atomic=true) else create_recursive_stores(B, Ty2, prev3)