Fix a bug about C Generator 15/264815/1
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 30 Sep 2021 07:26:41 +0000 (16:26 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Thu, 30 Sep 2021 07:26:41 +0000 (16:26 +0900)
If the direction of the parameter type is not 'IN', the method handler
MUST not read the data from the parcel handle.

Change-Id: Ifb792140a2f0f74173605ab31265a05280cd05a9
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
idlc/gen/c_stub_body_gen.cc

index 03a29b38235788106f31c4b3b45ced4a5e59c1b8..0d571cd756ebd02cd2024f2d49c03b72ddab70d8 100644 (file)
@@ -404,6 +404,9 @@ std::string CStubBodyGen::GenMethodHandlerParcelRead(const Interface& iface,
   for (auto& p : decl.GetParameters().GetParams()) {
     std::string parcel_read_code;
     auto& param_type = p->GetParameterType();
+    if (param_type.GetDirection() != ParameterType::Direction::IN)
+      continue;
+
     auto& type = param_type.GetBaseType();
     if (IsDelegateType(iface, type)) {
       parcel_read_code = ReplaceAll(