summaryrefslogtreecommitdiffstats
path: root/yql/essentials/minikql/computation
diff options
context:
space:
mode:
authorimunkin <[email protected]>2025-02-21 17:50:44 +0300
committerimunkin <[email protected]>2025-02-21 18:57:30 +0300
commit253d0dcf6c3fbbbf0594538d398123fc4eb9ae68 (patch)
treeb05802620889abc6a2fa42dcf9c3d0fda1aafc73 /yql/essentials/minikql/computation
parent538f420e8da04056c95eb9ed00c88f1691eddf0f (diff)
YQL-19618: Fix codegen in SafeUnRefUnboxedArray
commit_hash:b046f9169a163726d8afeab5f5b58bc8450d0e1b
Diffstat (limited to 'yql/essentials/minikql/computation')
-rw-r--r--yql/essentials/minikql/computation/mkql_computation_node_codegen.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/yql/essentials/minikql/computation/mkql_computation_node_codegen.cpp b/yql/essentials/minikql/computation/mkql_computation_node_codegen.cpp
index 23be45fa194..1b4984d1dc0 100644
--- a/yql/essentials/minikql/computation/mkql_computation_node_codegen.cpp
+++ b/yql/essentials/minikql/computation/mkql_computation_node_codegen.cpp
@@ -1738,13 +1738,12 @@ void SafeUnRefUnboxedOne(Value* pointer, const TCodegenContext& ctx, BasicBlock*
}
void SafeUnRefUnboxedArray(Value* pointer, ArrayType* arrayType, const TCodegenContext& ctx, BasicBlock*& block) {
- auto itemType = arrayType->getElementType();
const auto indexType = Type::getInt64Ty(ctx.Codegen.GetContext());
- Value* zeros = UndefValue::get(itemType);
+ Value* zeros = UndefValue::get(arrayType);
for (ui32 idx = 0U; idx < arrayType->getNumElements(); ++idx) {
- const auto item = GetElementPtrInst::CreateInBounds(itemType, pointer, { ConstantInt::get(indexType, 0), ConstantInt::get(indexType, idx) }, (TString("item_") += ToString(idx)).c_str(), block);
+ const auto item = GetElementPtrInst::CreateInBounds(arrayType, pointer, { ConstantInt::get(indexType, 0), ConstantInt::get(indexType, idx) }, (TString("item_") += ToString(idx)).c_str(), block);
UnRefUnboxed(item, ctx, block);
- zeros = InsertValueInst::Create(zeros, ConstantInt::get(itemType->getArrayElementType(), 0), {idx}, (TString("zero_") += ToString(idx)).c_str(), block);
+ zeros = InsertValueInst::Create(zeros, ConstantInt::get(arrayType->getArrayElementType(), 0), {idx}, (TString("zero_") += ToString(idx)).c_str(), block);
}
new StoreInst(zeros, pointer, block);
}