Skip to content

Commit 21f509e

Browse files
igormunkinblinkov
authored andcommitted
YQL-19618: Fix codegen in SafeUnRefUnboxedArray
commit_hash:b046f9169a163726d8afeab5f5b58bc8450d0e1b
1 parent 0c1c043 commit 21f509e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

yql/essentials/minikql/computation/mkql_computation_node_codegen.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1738,13 +1738,12 @@ void SafeUnRefUnboxedOne(Value* pointer, const TCodegenContext& ctx, BasicBlock*
17381738
}
17391739

17401740
void SafeUnRefUnboxedArray(Value* pointer, ArrayType* arrayType, const TCodegenContext& ctx, BasicBlock*& block) {
1741-
auto itemType = arrayType->getElementType();
17421741
const auto indexType = Type::getInt64Ty(ctx.Codegen.GetContext());
1743-
Value* zeros = UndefValue::get(itemType);
1742+
Value* zeros = UndefValue::get(arrayType);
17441743
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);
17461745
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);
17481747
}
17491748
new StoreInst(zeros, pointer, block);
17501749
}

0 commit comments

Comments
 (0)