diff options
author | imunkin <imunkin@yandex-team.com> | 2025-02-21 17:50:44 +0300 |
---|---|---|
committer | imunkin <imunkin@yandex-team.com> | 2025-02-21 18:57:30 +0300 |
commit | 253d0dcf6c3fbbbf0594538d398123fc4eb9ae68 (patch) | |
tree | b05802620889abc6a2fa42dcf9c3d0fda1aafc73 | |
parent | 538f420e8da04056c95eb9ed00c88f1691eddf0f (diff) | |
download | ydb-253d0dcf6c3fbbbf0594538d398123fc4eb9ae68.tar.gz |
YQL-19618: Fix codegen in SafeUnRefUnboxedArray
commit_hash:b046f9169a163726d8afeab5f5b58bc8450d0e1b
-rw-r--r-- | yql/essentials/minikql/computation/mkql_computation_node_codegen.cpp | 7 |
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 23be45fa19..1b4984d1dc 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); } |