diff options
author | Feng Xiao <xiaofeng@google.com> | 2016-05-04 10:55:13 -0700 |
---|---|---|
committer | Feng Xiao <xiaofeng@google.com> | 2016-05-04 10:55:13 -0700 |
commit | 17b6fc31eb8a9b65501cd7c53235a88efdc94394 (patch) | |
tree | 20b5c3cc69f7643b139a9d498563f9cabbbf34b6 /src/google/protobuf/compiler/cpp/cpp_enum_field.cc | |
parent | 72e162ce96fcd153654a1ab7a26b67ab7278580b (diff) | |
parent | f4f9aec52f5b4c46ff32fb9527229da081a14e11 (diff) |
Merge pull request #1409 from eeight/fix_enum_corruption
Fix bug with silent message corruption in LITE_RUNTIME.
Diffstat (limited to 'src/google/protobuf/compiler/cpp/cpp_enum_field.cc')
-rw-r--r-- | src/google/protobuf/compiler/cpp/cpp_enum_field.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/google/protobuf/compiler/cpp/cpp_enum_field.cc b/src/google/protobuf/compiler/cpp/cpp_enum_field.cc index 78a4c402..10252b39 100644 --- a/src/google/protobuf/compiler/cpp/cpp_enum_field.cc +++ b/src/google/protobuf/compiler/cpp/cpp_enum_field.cc @@ -36,6 +36,7 @@ #include <google/protobuf/compiler/cpp/cpp_helpers.h> #include <google/protobuf/io/printer.h> #include <google/protobuf/stubs/strutil.h> +#include <google/protobuf/wire_format.h> namespace google { namespace protobuf { @@ -141,8 +142,9 @@ GenerateMergeFromCodedStream(io::Printer* printer) const { } else { printer->Print( "} else {\n" - " unknown_fields_stream.WriteVarint32(tag);\n" - " unknown_fields_stream.WriteVarint32(value);\n"); + " unknown_fields_stream.WriteVarint32($tag$);\n" + " unknown_fields_stream.WriteVarint32(value);\n", + "tag", SimpleItoa(internal::WireFormat::MakeTag(descriptor_))); } printer->Print(variables_, "}\n"); |