aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/message.cc
diff options
context:
space:
mode:
authorGravatar Jisi Liu <jisi.liu@gmail.com>2017-07-18 15:38:30 -0700
committerGravatar Jisi Liu <jisi.liu@gmail.com>2017-07-18 15:38:30 -0700
commit09354db1434859a31a3c81abebcc4018d42f2715 (patch)
treeb87c7cdc2255e6c8062ab92b4082665cd698d753 /src/google/protobuf/message.cc
parent9053033a5076f82cf18b823c31f352e95e5bfd8d (diff)
Merge from Google internal for 3.4 release
Diffstat (limited to 'src/google/protobuf/message.cc')
-rw-r--r--src/google/protobuf/message.cc12
1 files changed, 11 insertions, 1 deletions
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<const internal::SerializationTable*>(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<TYPE>& Reflection::GetRepeatedField<TYPE>( \