diff options
author | thegeorg <thegeorg@yandex-team.com> | 2022-09-16 11:43:03 +0300 |
---|---|---|
committer | thegeorg <thegeorg@yandex-team.com> | 2022-09-16 11:43:03 +0300 |
commit | cb4b2fb05910b1c77f8c6ffe0f408080792fec75 (patch) | |
tree | ba3862484ab2b0b03ef3dc4042fdd4ecb4545ea2 | |
parent | 8e8404d861c98b884936157f993d5c8be04825f8 (diff) | |
download | ydb-cb4b2fb05910b1c77f8c6ffe0f408080792fec75.tar.gz |
Update contrib/libs/protobuf{_std} to 3.18.3
18 files changed, 76 insertions, 40 deletions
diff --git a/contrib/libs/protobuf/CHANGES.txt b/contrib/libs/protobuf/CHANGES.txt index 69207d6ae9..b7866d502b 100644 --- a/contrib/libs/protobuf/CHANGES.txt +++ b/contrib/libs/protobuf/CHANGES.txt @@ -1,3 +1,11 @@ +2022-09-13 version 18.3 (C++/Java/Python/PHP/Objective-C/C#/Ruby) + + +2022-01-05 version 3.18.2 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) + + Java + * Improve performance characteristics of UnknownFieldSet parsing (#9371) + 2021-10-04 version 3.18.1 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) Python diff --git a/contrib/libs/protobuf/src/google/protobuf/any.pb.h b/contrib/libs/protobuf/src/google/protobuf/any.pb.h index fd7af0bf34..ab1d1dae11 100644 --- a/contrib/libs/protobuf/src/google/protobuf/any.pb.h +++ b/contrib/libs/protobuf/src/google/protobuf/any.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3018001 < PROTOBUF_MIN_PROTOC_VERSION +#if 3018003 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/contrib/libs/protobuf/src/google/protobuf/api.pb.h b/contrib/libs/protobuf/src/google/protobuf/api.pb.h index 34f4fca0c9..a17787abcc 100644 --- a/contrib/libs/protobuf/src/google/protobuf/api.pb.h +++ b/contrib/libs/protobuf/src/google/protobuf/api.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3018001 < PROTOBUF_MIN_PROTOC_VERSION +#if 3018003 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/contrib/libs/protobuf/src/google/protobuf/descriptor.pb.h b/contrib/libs/protobuf/src/google/protobuf/descriptor.pb.h index 87523484d2..197ea516aa 100644 --- a/contrib/libs/protobuf/src/google/protobuf/descriptor.pb.h +++ b/contrib/libs/protobuf/src/google/protobuf/descriptor.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3018001 < PROTOBUF_MIN_PROTOC_VERSION +#if 3018003 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/contrib/libs/protobuf/src/google/protobuf/duration.pb.h b/contrib/libs/protobuf/src/google/protobuf/duration.pb.h index 4e7d6adc97..aa3baf51e6 100644 --- a/contrib/libs/protobuf/src/google/protobuf/duration.pb.h +++ b/contrib/libs/protobuf/src/google/protobuf/duration.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3018001 < PROTOBUF_MIN_PROTOC_VERSION +#if 3018003 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/contrib/libs/protobuf/src/google/protobuf/empty.pb.h b/contrib/libs/protobuf/src/google/protobuf/empty.pb.h index 637ddf4d65..6fe2769c21 100644 --- a/contrib/libs/protobuf/src/google/protobuf/empty.pb.h +++ b/contrib/libs/protobuf/src/google/protobuf/empty.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3018001 < PROTOBUF_MIN_PROTOC_VERSION +#if 3018003 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/contrib/libs/protobuf/src/google/protobuf/extension_set_inl.h b/contrib/libs/protobuf/src/google/protobuf/extension_set_inl.h index 8d5f45f37e..513bd12010 100644 --- a/contrib/libs/protobuf/src/google/protobuf/extension_set_inl.h +++ b/contrib/libs/protobuf/src/google/protobuf/extension_set_inl.h @@ -206,16 +206,21 @@ const char* ExtensionSet::ParseMessageSetItemTmpl( const char* ptr, const Msg* extendee, internal::InternalMetadata* metadata, internal::ParseContext* ctx) { TProtoStringType payload; - uint32_t type_id = 0; - bool payload_read = false; + uint32_t type_id; + enum class State { kNoTag, kHasType, kHasPayload, kDone }; + State state = State::kNoTag; + while (!ctx->Done(&ptr)) { uint32_t tag = static_cast<uint8_t>(*ptr++); if (tag == WireFormatLite::kMessageSetTypeIdTag) { uint64_t tmp; ptr = ParseBigVarint(ptr, &tmp); GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); - type_id = tmp; - if (payload_read) { + if (state == State::kNoTag) { + type_id = tmp; + state = State::kHasType; + } else if (state == State::kHasPayload) { + type_id = tmp; ExtensionInfo extension; bool was_packed_on_wire; if (!FindExtension(2, type_id, extendee, ctx, &extension, @@ -241,20 +246,24 @@ const char* ExtensionSet::ParseMessageSetItemTmpl( GOOGLE_PROTOBUF_PARSER_ASSERT(value->_InternalParse(p, &tmp_ctx) && tmp_ctx.EndedAtLimit()); } - type_id = 0; + state = State::kDone; } } else if (tag == WireFormatLite::kMessageSetMessageTag) { - if (type_id != 0) { + if (state == State::kHasType) { ptr = ParseFieldMaybeLazily(static_cast<uint64_t>(type_id) * 8 + 2, ptr, extendee, metadata, ctx); GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr); - type_id = 0; + state = State::kDone; } else { + TProtoStringType tmp; int32_t size = ReadSize(&ptr); GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); - ptr = ctx->ReadString(ptr, size, &payload); + ptr = ctx->ReadString(ptr, size, &tmp); GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); - payload_read = true; + if (state == State::kNoTag) { + payload = std::move(tmp); + state = State::kHasPayload; + } } } else { ptr = ReadTag(ptr - 1, &tag); diff --git a/contrib/libs/protobuf/src/google/protobuf/field_mask.pb.h b/contrib/libs/protobuf/src/google/protobuf/field_mask.pb.h index 02c07a7776..14d931a571 100644 --- a/contrib/libs/protobuf/src/google/protobuf/field_mask.pb.h +++ b/contrib/libs/protobuf/src/google/protobuf/field_mask.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3018001 < PROTOBUF_MIN_PROTOC_VERSION +#if 3018003 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/contrib/libs/protobuf/src/google/protobuf/port_def.inc b/contrib/libs/protobuf/src/google/protobuf/port_def.inc index d488975a39..a0d33dbe5b 100644 --- a/contrib/libs/protobuf/src/google/protobuf/port_def.inc +++ b/contrib/libs/protobuf/src/google/protobuf/port_def.inc @@ -153,7 +153,7 @@ #ifdef PROTOBUF_VERSION #error PROTOBUF_VERSION was previously defined #endif -#define PROTOBUF_VERSION 3018001 +#define PROTOBUF_VERSION 3018003 #ifdef PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC #error PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC was previously defined diff --git a/contrib/libs/protobuf/src/google/protobuf/source_context.pb.h b/contrib/libs/protobuf/src/google/protobuf/source_context.pb.h index b51f1a215e..3b168cc244 100644 --- a/contrib/libs/protobuf/src/google/protobuf/source_context.pb.h +++ b/contrib/libs/protobuf/src/google/protobuf/source_context.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3018001 < PROTOBUF_MIN_PROTOC_VERSION +#if 3018003 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/contrib/libs/protobuf/src/google/protobuf/struct.pb.h b/contrib/libs/protobuf/src/google/protobuf/struct.pb.h index 53e6120f40..aa87bdcfd2 100644 --- a/contrib/libs/protobuf/src/google/protobuf/struct.pb.h +++ b/contrib/libs/protobuf/src/google/protobuf/struct.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3018001 < PROTOBUF_MIN_PROTOC_VERSION +#if 3018003 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/contrib/libs/protobuf/src/google/protobuf/stubs/common.h b/contrib/libs/protobuf/src/google/protobuf/stubs/common.h index d9bb76d731..fbd9f558a1 100644 --- a/contrib/libs/protobuf/src/google/protobuf/stubs/common.h +++ b/contrib/libs/protobuf/src/google/protobuf/stubs/common.h @@ -84,7 +84,7 @@ namespace internal { // The current version, represented as a single integer to make comparison // easier: major * 10^6 + minor * 10^3 + micro -#define GOOGLE_PROTOBUF_VERSION 3018001 +#define GOOGLE_PROTOBUF_VERSION 3018003 // A suffix string for alpha, beta or rc releases. Empty for stable releases. #define GOOGLE_PROTOBUF_VERSION_SUFFIX "" diff --git a/contrib/libs/protobuf/src/google/protobuf/timestamp.pb.h b/contrib/libs/protobuf/src/google/protobuf/timestamp.pb.h index f5c7f9882d..3b4971a20b 100644 --- a/contrib/libs/protobuf/src/google/protobuf/timestamp.pb.h +++ b/contrib/libs/protobuf/src/google/protobuf/timestamp.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3018001 < PROTOBUF_MIN_PROTOC_VERSION +#if 3018003 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/contrib/libs/protobuf/src/google/protobuf/type.pb.h b/contrib/libs/protobuf/src/google/protobuf/type.pb.h index d9ec25e0fa..c7e2f6dd6f 100644 --- a/contrib/libs/protobuf/src/google/protobuf/type.pb.h +++ b/contrib/libs/protobuf/src/google/protobuf/type.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3018001 < PROTOBUF_MIN_PROTOC_VERSION +#if 3018003 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/contrib/libs/protobuf/src/google/protobuf/wire_format.cc b/contrib/libs/protobuf/src/google/protobuf/wire_format.cc index 7474c68286..0f265b2eb7 100644 --- a/contrib/libs/protobuf/src/google/protobuf/wire_format.cc +++ b/contrib/libs/protobuf/src/google/protobuf/wire_format.cc @@ -657,9 +657,11 @@ struct WireFormat::MessageSetParser { const char* _InternalParse(const char* ptr, internal::ParseContext* ctx) { // Parse a MessageSetItem auto metadata = reflection->MutableInternalMetadata(msg); + enum class State { kNoTag, kHasType, kHasPayload, kDone }; + State state = State::kNoTag; + TProtoStringType payload; uint32_t type_id = 0; - bool payload_read = false; while (!ctx->Done(&ptr)) { // We use 64 bit tags in order to allow typeid's that span the whole // range of 32 bit numbers. @@ -668,8 +670,11 @@ struct WireFormat::MessageSetParser { uint64_t tmp; ptr = ParseBigVarint(ptr, &tmp); GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); - type_id = tmp; - if (payload_read) { + if (state == State::kNoTag) { + type_id = tmp; + state = State::kHasType; + } else if (state == State::kHasPayload) { + type_id = tmp; const FieldDescriptor* field; if (ctx->data().pool == nullptr) { field = reflection->FindKnownExtensionByNumber(type_id); @@ -696,17 +701,17 @@ struct WireFormat::MessageSetParser { GOOGLE_PROTOBUF_PARSER_ASSERT(value->_InternalParse(p, &tmp_ctx) && tmp_ctx.EndedAtLimit()); } - type_id = 0; + state = State::kDone; } continue; } else if (tag == WireFormatLite::kMessageSetMessageTag) { - if (type_id == 0) { + if (state == State::kNoTag) { int32_t size = ReadSize(&ptr); GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); ptr = ctx->ReadString(ptr, size, &payload); GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); - payload_read = true; - } else { + state = State::kHasPayload; + } else if (state == State::kHasType) { // We're now parsing the payload const FieldDescriptor* field = nullptr; if (descriptor->IsExtensionNumber(type_id)) { @@ -720,7 +725,12 @@ struct WireFormat::MessageSetParser { ptr = WireFormat::_InternalParseAndMergeField( msg, ptr, ctx, static_cast<uint64_t>(type_id) * 8 + 2, reflection, field); - type_id = 0; + state = State::kDone; + } else { + int32_t size = ReadSize(&ptr); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + ptr = ctx->Skip(ptr, size); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); } } else { // An unknown field in MessageSetItem. diff --git a/contrib/libs/protobuf/src/google/protobuf/wire_format_lite.h b/contrib/libs/protobuf/src/google/protobuf/wire_format_lite.h index bb6019983f..7412457369 100644 --- a/contrib/libs/protobuf/src/google/protobuf/wire_format_lite.h +++ b/contrib/libs/protobuf/src/google/protobuf/wire_format_lite.h @@ -2085,6 +2085,9 @@ bool ParseMessageSetItemImpl(io::CodedInputStream* input, MS ms) { // we can parse it later. TProtoStringType message_data; + enum class State { kNoTag, kHasType, kHasPayload, kDone }; + State state = State::kNoTag; + while (true) { const uint32_t tag = input->ReadTagNoLastTag(); if (tag == 0) return false; @@ -2093,26 +2096,34 @@ bool ParseMessageSetItemImpl(io::CodedInputStream* input, MS ms) { case WireFormatLite::kMessageSetTypeIdTag: { uint32_t type_id; if (!input->ReadVarint32(&type_id)) return false; - last_type_id = type_id; - - if (!message_data.empty()) { + if (state == State::kNoTag) { + last_type_id = type_id; + state = State::kHasType; + } else if (state == State::kHasPayload) { // We saw some message data before the type_id. Have to parse it // now. io::CodedInputStream sub_input( reinterpret_cast<const uint8_t*>(message_data.data()), static_cast<int>(message_data.size())); sub_input.SetRecursionLimit(input->RecursionBudget()); - if (!ms.ParseField(last_type_id, &sub_input)) { + if (!ms.ParseField(type_id, &sub_input)) { return false; } message_data.clear(); + state = State::kDone; } break; } case WireFormatLite::kMessageSetMessageTag: { - if (last_type_id == 0) { + if (state == State::kHasType) { + // Already saw type_id, so we can parse this directly. + if (!ms.ParseField(last_type_id, input)) { + return false; + } + state = State::kDone; + } else if (state == State::kNoTag) { // We haven't seen a type_id yet. Append this data to message_data. uint32_t length; if (!input->ReadVarint32(&length)) return false; @@ -2123,11 +2134,9 @@ bool ParseMessageSetItemImpl(io::CodedInputStream* input, MS ms) { auto ptr = reinterpret_cast<uint8_t*>(&message_data[0]); ptr = io::CodedOutputStream::WriteVarint32ToArray(length, ptr); if (!input->ReadRaw(ptr, length)) return false; + state = State::kHasPayload; } else { - // Already saw type_id, so we can parse this directly. - if (!ms.ParseField(last_type_id, input)) { - return false; - } + if (!ms.SkipField(tag, input)) return false; } break; diff --git a/contrib/libs/protobuf/src/google/protobuf/wrappers.pb.h b/contrib/libs/protobuf/src/google/protobuf/wrappers.pb.h index e41e150ba0..4027d32865 100644 --- a/contrib/libs/protobuf/src/google/protobuf/wrappers.pb.h +++ b/contrib/libs/protobuf/src/google/protobuf/wrappers.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3018001 < PROTOBUF_MIN_PROTOC_VERSION +#if 3018003 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/plugin.pb.h b/contrib/libs/protoc/src/google/protobuf/compiler/plugin.pb.h index 9d0e84637a..3b198910a1 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/plugin.pb.h +++ b/contrib/libs/protoc/src/google/protobuf/compiler/plugin.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3018001 < PROTOBUF_MIN_PROTOC_VERSION +#if 3018003 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. |