Fix static issues 13/264913/2
authorChanggyu Choi <changyu.choi@samsung.com>
Tue, 5 Oct 2021 04:43:56 +0000 (13:43 +0900)
committerChanggyu Choi <changyu.choi@samsung.com>
Tue, 5 Oct 2021 04:51:22 +0000 (13:51 +0900)
Change-Id: I0eded72a290914ace05df108efc2021ce2c1894a
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
idlc/gen/cpp_gen_base.cc
idlc/gen/cs_gen_base.cc

index 83aaf1efb6acdf29600db594794d13cec5cff438..1e45d2749543713f9ff0e0b2798dabb74939a2a4 100644 (file)
@@ -383,7 +383,11 @@ void CppGeneratorBase::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();
+      auto* ptr = type.GetMetaType();
+      if (ptr == nullptr)
+        return;
+
+      auto& mt = *ptr;
       stream << AddIndent(TAB_SIZE * 2,
           ConvertTypeToDeserializer(mt, "v", "h", true));
       stream << Tab(2) << "c.push_back(std::move(v));" << NLine(1);
index 4266ba31789b8244e3fcbbab85e6247b27db30c2..480fda821e108b89de80da570beb98a7c1c8e136 100644 (file)
@@ -183,7 +183,11 @@ void CsGeneratorBase::GenListSerializer(std::ofstream& stream,
            << NLine(1);
     stream << Tab(4) << "for (int i = 0; i < l; i++)" << NLine(1);
     GenBrace(stream, TAB_SIZE * 4, [&]() {
-      auto& mt = *type.GetMetaType();
+      auto* ptr = type.GetMetaType();
+      if (ptr == nullptr)
+        return;
+
+      auto& mt = *ptr;
       if (!mt.IsUserDefinedType() && mt.GetMetaType() == nullptr) {
         stream << Tab(5) << "var v = h.Read"
                          << ConvertTypeToParcelType(mt.ToString())