|
|
@ -5487,6 +5487,12 @@ void DescriptorBuilder::BuildMessage(const DescriptorProto& proto, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace { |
|
|
|
|
|
|
|
bool IsAllowedReservedField(const FieldDescriptorProto& field) { |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
|
|
|
|
void DescriptorBuilder::BuildFieldOrExtension(const FieldDescriptorProto& proto, |
|
|
|
void DescriptorBuilder::BuildFieldOrExtension(const FieldDescriptorProto& proto, |
|
|
|
Descriptor* parent, |
|
|
|
Descriptor* parent, |
|
|
|
FieldDescriptor* result, |
|
|
|
FieldDescriptor* result, |
|
|
@ -5713,7 +5719,8 @@ void DescriptorBuilder::BuildFieldOrExtension(const FieldDescriptorProto& proto, |
|
|
|
absl::Substitute("Field numbers cannot be greater than $0.", |
|
|
|
absl::Substitute("Field numbers cannot be greater than $0.", |
|
|
|
FieldDescriptor::kMaxNumber)); |
|
|
|
FieldDescriptor::kMaxNumber)); |
|
|
|
} else if (result->number() >= FieldDescriptor::kFirstReservedNumber && |
|
|
|
} else if (result->number() >= FieldDescriptor::kFirstReservedNumber && |
|
|
|
result->number() <= FieldDescriptor::kLastReservedNumber) { |
|
|
|
result->number() <= FieldDescriptor::kLastReservedNumber && |
|
|
|
|
|
|
|
!IsAllowedReservedField(proto)) { |
|
|
|
message_hints_[parent].RequestHintOnFieldNumbers( |
|
|
|
message_hints_[parent].RequestHintOnFieldNumbers( |
|
|
|
proto, DescriptorPool::ErrorCollector::NUMBER); |
|
|
|
proto, DescriptorPool::ErrorCollector::NUMBER); |
|
|
|
AddError(result->full_name(), proto, DescriptorPool::ErrorCollector::NUMBER, |
|
|
|
AddError(result->full_name(), proto, DescriptorPool::ErrorCollector::NUMBER, |
|
|
|