aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/compiler/csharp
diff options
context:
space:
mode:
authorGravatar Jon Skeet <jonskeet@google.com>2015-08-04 11:26:48 +0100
committerGravatar Jon Skeet <jonskeet@google.com>2015-08-05 07:09:41 +0100
commit9df2defa295e1a3b315ed2a88791db51ff1f53e7 (patch)
tree5a0b130c7e82321c99954c4e86e29983e88d3bb6 /src/google/protobuf/compiler/csharp
parentb6defa7c115a19d3671b2a6c5ebab2a471d273ea (diff)
Consume unknown fields when parsing.
This is expected to be the cause of the conformance test failures. Generated code in next commit.
Diffstat (limited to 'src/google/protobuf/compiler/csharp')
-rw-r--r--src/google/protobuf/compiler/csharp/csharp_message.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/google/protobuf/compiler/csharp/csharp_message.cc b/src/google/protobuf/compiler/csharp/csharp_message.cc
index 6ea568ca..ea722455 100644
--- a/src/google/protobuf/compiler/csharp/csharp_message.cc
+++ b/src/google/protobuf/compiler/csharp/csharp_message.cc
@@ -428,7 +428,8 @@ void MessageGenerator::GenerateMergingMethods(io::Printer* printer) {
" if (pb::WireFormat.IsEndGroupTag(tag)) {\n"
" return;\n"
" }\n"
- " break;\n"); // Note: we're ignoring unknown fields here.
+ " input.ConsumeLastField();\n" // We're not storing the data, but we still need to consume it.
+ " break;\n");
for (int i = 0; i < fields_by_number().size(); i++) {
const FieldDescriptor* field = fields_by_number()[i];
internal::WireFormatLite::WireType wt =