aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authora-romanov <Anton.Romanov@ydb.tech>2023-10-22 18:35:30 +0300
committera-romanov <Anton.Romanov@ydb.tech>2023-10-22 19:02:57 +0300
commit1a21631ab8cf2a29afe6498d3bb6471c922860bc (patch)
tree6fcf2c6b0f511a28e7e2f3f8ea9e3053b10802b3
parentc9771ff2630c6daed12f07ef0090afa9f062a921 (diff)
downloadydb-1a21631ab8cf2a29afe6498d3bb6471c922860bc.tar.gz
YQL-16757 LLVM: Fix double free of temporary value.
-rw-r--r--ydb/library/yql/providers/yt/codec/codegen/yt_codec_cg.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/ydb/library/yql/providers/yt/codec/codegen/yt_codec_cg.cpp b/ydb/library/yql/providers/yt/codec/codegen/yt_codec_cg.cpp
index 5c6ac18149c..a3a442e1e6f 100644
--- a/ydb/library/yql/providers/yt/codec/codegen/yt_codec_cg.cpp
+++ b/ydb/library/yql/providers/yt/codec/codegen/yt_codec_cg.cpp
@@ -188,12 +188,11 @@ public:
const auto funcPtr = CastInst::Create(Instruction::IntToPtr, funcAddr, PointerType::getUnqual(funType), "ptr", Block_);
CallInst::Create(funType, funcPtr, { typeConst, elemPtr, buf }, "", Block_);
}
- TCodegenContext ctx(*Codegen_);
- ctx.Func = Func_;
- if constexpr (Flat)
- ValueCleanup(EValueRepresentation::Any, elemPtr, ctx, Block_);
- else
- ValueUnRef(EValueRepresentation::Any, elemPtr, ctx, Block_);
+ if constexpr (!Flat) {
+ TCodegenContext ctx(*Codegen_);
+ ctx.Func = Func_;
+ ValueUnRef(GetValueRepresentation(type), elemPtr, ctx, Block_);
+ }
}
void GenerateData(Value* elemPtr, Value* buf, NKikimr::NMiniKQL::TType* type, ui64 nativeYtTypeFlags) {