From 09354db1434859a31a3c81abebcc4018d42f2715 Mon Sep 17 00:00:00 2001 From: Jisi Liu Date: Tue, 18 Jul 2017 15:38:30 -0700 Subject: Merge from Google internal for 3.4 release --- src/google/protobuf/message.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/google/protobuf/message.cc') diff --git a/src/google/protobuf/message.cc b/src/google/protobuf/message.cc index 2134f95f..c01d1974 100644 --- a/src/google/protobuf/message.cc +++ b/src/google/protobuf/message.cc @@ -143,7 +143,13 @@ bool Message::ParsePartialFromIstream(std::istream* input) { void Message::SerializeWithCachedSizes( io::CodedOutputStream* output) const { - WireFormat::SerializeWithCachedSizes(*this, GetCachedSize(), output); + const internal::SerializationTable* table = + static_cast(InternalGetTable()); + if (table == 0) { + WireFormat::SerializeWithCachedSizes(*this, GetCachedSize(), output); + } else { + internal::TableSerialize(*this, table, output); + } } size_t Message::ByteSizeLong() const { @@ -191,6 +197,10 @@ bool Message::SerializePartialToOstream(std::ostream* output) const { Reflection::~Reflection() {} +void Reflection::AddAllocatedMessage(Message* /* message */, + const FieldDescriptor* /*field */, + Message* /* new_entry */) const {} + #define HANDLE_TYPE(TYPE, CPPTYPE, CTYPE) \ template<> \ const RepeatedField& Reflection::GetRepeatedField( \ -- cgit v1.2.3