@@ -1738,13 +1738,12 @@ void SafeUnRefUnboxedOne(Value* pointer, const TCodegenContext& ctx, BasicBlock*
1738
1738
}
1739
1739
1740
1740
void SafeUnRefUnboxedArray (Value* pointer, ArrayType* arrayType, const TCodegenContext& ctx, BasicBlock*& block) {
1741
- auto itemType = arrayType->getElementType ();
1742
1741
const auto indexType = Type::getInt64Ty (ctx.Codegen .GetContext ());
1743
- Value* zeros = UndefValue::get (itemType );
1742
+ Value* zeros = UndefValue::get (arrayType );
1744
1743
for (ui32 idx = 0U ; idx < arrayType->getNumElements (); ++idx) {
1745
- const auto item = GetElementPtrInst::CreateInBounds (itemType , pointer, { ConstantInt::get (indexType, 0 ), ConstantInt::get (indexType, idx) }, (TString (" item_" ) += ToString (idx)).c_str (), block);
1744
+ const auto item = GetElementPtrInst::CreateInBounds (arrayType , pointer, { ConstantInt::get (indexType, 0 ), ConstantInt::get (indexType, idx) }, (TString (" item_" ) += ToString (idx)).c_str (), block);
1746
1745
UnRefUnboxed (item, ctx, block);
1747
- zeros = InsertValueInst::Create (zeros, ConstantInt::get (itemType ->getArrayElementType (), 0 ), {idx}, (TString (" zero_" ) += ToString (idx)).c_str (), block);
1746
+ zeros = InsertValueInst::Create (zeros, ConstantInt::get (arrayType ->getArrayElementType (), 0 ), {idx}, (TString (" zero_" ) += ToString (idx)).c_str (), block);
1748
1747
}
1749
1748
new StoreInst (zeros, pointer, block);
1750
1749
}
0 commit comments