From: Sangyoon Jang Date: Fri, 19 Nov 2021 05:21:22 +0000 (+0900) Subject: Fix static analysis issues X-Git-Tag: submit/tizen/20211119.063348~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F24%2F266824%2F2;p=platform%2Fcore%2Fappfw%2Ftidl.git Fix static analysis issues Change-Id: I65a4b531d37378b6e4e113f24718442c781d2a07 Signed-off-by: Sangyoon Jang --- diff --git a/idlc/gen_cion/cpp_cion_gen_base.cc b/idlc/gen_cion/cpp_cion_gen_base.cc index 407082a..ebba91f 100644 --- a/idlc/gen_cion/cpp_cion_gen_base.cc +++ b/idlc/gen_cion/cpp_cion_gen_base.cc @@ -368,8 +368,11 @@ void CppCionGeneratorBase::GenListSerializer(std::ofstream& stream, << NLine(1); stream << Tab(1) << "for (const auto& i : c) "; GenBrace(stream, TAB_SIZE, [&]() { - auto& mt = *type.GetMetaType(); - stream << AddIndent(TAB_SIZE * 2, ConvertTypeToSerializer(mt, "i", "h")); + if (type.GetMetaType() != nullptr) { + auto& mt = *type.GetMetaType(); + stream << AddIndent(TAB_SIZE * 2, + ConvertTypeToSerializer(mt, "i", "h")); + } }, false); stream << Tab(1) << "return h;" << NLine(1); }, false); @@ -383,10 +386,12 @@ void CppCionGeneratorBase::GenListSerializer(std::ofstream& stream, << "rpc_port_parcel_read_array_count(h, &l);" << NLine(1); stream << Tab(1) << "for (int i = 0; i < l; i++) "; GenBrace(stream, TAB_SIZE, [&]() { - auto& mt = *type.GetMetaType(); - stream << AddIndent(TAB_SIZE * 2, - ConvertTypeToDeserializer(mt, "v", "h", true)); - stream << Tab(2) << "c.push_back(std::move(v));" << NLine(1); + if (type.GetMetaType() != nullptr) { + auto& mt = *type.GetMetaType(); + stream << AddIndent(TAB_SIZE * 2, + ConvertTypeToDeserializer(mt, "v", "h", true)); + stream << Tab(2) << "c.push_back(std::move(v));" << NLine(1); + } }, false); stream << Tab(1) << "return h;" << NLine(1); }, false);