THRIFT-1413: Generated code does not read MapEnd / ListEnd / SetEnd
Client: delphi
Patch: Jens Geyer

The generated code lacks calls to ReadMapEnd, ReadListEnd and ReadSetEnd. Although actually no problem occurs with the BinaryProtocol, other protocols (like JSON) do some important things there.



git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1195466 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/src/generate/t_delphi_generator.cc b/compiler/cpp/src/generate/t_delphi_generator.cc
index 569afe3..0215e3c 100644
--- a/compiler/cpp/src/generate/t_delphi_generator.cc
+++ b/compiler/cpp/src/generate/t_delphi_generator.cc
@@ -1765,6 +1765,14 @@
   }
   indent_down_impl();
   indent_impl(out) << "end;" << endl;
+
+  if (ttype->is_map()) {
+    indent_impl(out) << "iprot.ReadMapEnd();" << endl;
+  } else if (ttype->is_set()) {
+    indent_impl(out) << "iprot.ReadSetEnd();" << endl;
+  } else if (ttype->is_list()) {
+    indent_impl(out) << "iprot.ReadListEnd();" << endl;
+  }
 }
 
 void t_delphi_generator::generate_deserialize_map_element(ostream& out, bool is_xception, t_map* tmap, string prefix, ostream& local_vars) {