diff options
author | aozeritsky <aozeritsky@ydb.tech> | 2023-09-27 16:27:10 +0300 |
---|---|---|
committer | aozeritsky <aozeritsky@ydb.tech> | 2023-09-27 16:54:04 +0300 |
commit | 2a6fc3de1e8e1ceebc3fc5e9ca1c9d4b262eb815 (patch) | |
tree | 00d4f93a6f9c30706abfc85b553a83cfbdde76a6 | |
parent | 773c806102c157921703736c355c824152b6e439 (diff) | |
download | ydb-2a6fc3de1e8e1ceebc3fc5e9ca1c9d4b262eb815.tar.gz |
Fix UB: store arguments in vector
-rw-r--r-- | ydb/library/yql/parser/pg_wrapper/comp_factory.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ydb/library/yql/parser/pg_wrapper/comp_factory.cpp b/ydb/library/yql/parser/pg_wrapper/comp_factory.cpp index c897505018e..2863050f4e7 100644 --- a/ydb/library/yql/parser/pg_wrapper/comp_factory.cpp +++ b/ydb/library/yql/parser/pg_wrapper/comp_factory.cpp @@ -386,10 +386,12 @@ struct TPgResolvedCallState : public TComputationValue<TPgResolvedCallState> { TPgResolvedCallState(TMemoryUsageInfo* memInfo, ui32 numArgs, const FmgrInfo* finfo) : TComputationValue(memInfo) , CallInfo(numArgs, finfo) + , Args(numArgs) { } TFunctionCallInfo CallInfo; + TUnboxedValueVector Args; }; template <bool UseContext> @@ -406,13 +408,15 @@ public: NUdf::TUnboxedValuePod DoCalculate(TComputationContext& compCtx) const { auto& state = this->GetState(compCtx); auto& callInfo = state.CallInfo.Ref(); + auto& args = state.Args; if constexpr (UseContext) { callInfo.context = (Node*)TlsAllocState->CurrentContext; } callInfo.isnull = false; for (ui32 i = 0; i < this->ArgNodes.size(); ++i) { - auto value = this->ArgNodes[i]->GetValue(compCtx); + args[i] = std::move(this->ArgNodes[i]->GetValue(compCtx)); + auto& value = args[i]; NullableDatum argDatum = { 0, false }; if (!value) { if (this->FInfo.fn_strict) { |