pull/13171/head
Joshua Haberman 3 years ago
parent 6f18f3e57e
commit af6574a416
  1. 10
      cmake/google/protobuf/descriptor.upb.c
  2. 2
      upb/upb.h
  3. 4
      upbc/protoc-gen-upb.cc

@ -184,7 +184,7 @@ static const upb_MiniTable_Field google_protobuf_EnumDescriptorProto__fields[5]
const upb_MiniTable google_protobuf_EnumDescriptorProto_msginit = {
&google_protobuf_EnumDescriptorProto_submsgs[0],
&google_protobuf_EnumDescriptorProto__fields[0],
UPB_SIZE(32, 64), 5, upb_ExtMode_NonExtendable, 5, 255, 0,
UPB_SIZE(32, 56), 5, upb_ExtMode_NonExtendable, 5, 255, 0,
};
static const upb_MiniTable_Field google_protobuf_EnumDescriptorProto_EnumReservedRange__fields[2] = {
@ -228,7 +228,7 @@ static const upb_MiniTable_Field google_protobuf_ServiceDescriptorProto__fields[
const upb_MiniTable google_protobuf_ServiceDescriptorProto_msginit = {
&google_protobuf_ServiceDescriptorProto_submsgs[0],
&google_protobuf_ServiceDescriptorProto__fields[0],
UPB_SIZE(24, 48), 3, upb_ExtMode_NonExtendable, 3, 255, 0,
UPB_SIZE(24, 40), 3, upb_ExtMode_NonExtendable, 3, 255, 0,
};
static const upb_MiniTable_Sub google_protobuf_MethodDescriptorProto_submsgs[1] = {
@ -420,7 +420,7 @@ static const upb_MiniTable_Field google_protobuf_UninterpretedOption__fields[7]
const upb_MiniTable google_protobuf_UninterpretedOption_msginit = {
&google_protobuf_UninterpretedOption_submsgs[0],
&google_protobuf_UninterpretedOption__fields[0],
UPB_SIZE(64, 96), 7, upb_ExtMode_NonExtendable, 0, 255, 0,
UPB_SIZE(64, 88), 7, upb_ExtMode_NonExtendable, 0, 255, 0,
};
static const upb_MiniTable_Field google_protobuf_UninterpretedOption_NamePart__fields[2] = {
@ -431,7 +431,7 @@ static const upb_MiniTable_Field google_protobuf_UninterpretedOption_NamePart__f
const upb_MiniTable google_protobuf_UninterpretedOption_NamePart_msginit = {
NULL,
&google_protobuf_UninterpretedOption_NamePart__fields[0],
UPB_SIZE(16, 32), 2, upb_ExtMode_NonExtendable, 2, 255, 2,
UPB_SIZE(16, 24), 2, upb_ExtMode_NonExtendable, 2, 255, 2,
};
static const upb_MiniTable_Sub google_protobuf_SourceCodeInfo_submsgs[1] = {
@ -486,7 +486,7 @@ static const upb_MiniTable_Field google_protobuf_GeneratedCodeInfo_Annotation__f
const upb_MiniTable google_protobuf_GeneratedCodeInfo_Annotation_msginit = {
NULL,
&google_protobuf_GeneratedCodeInfo_Annotation__fields[0],
UPB_SIZE(24, 48), 4, upb_ExtMode_NonExtendable, 4, 255, 0,
UPB_SIZE(24, 40), 4, upb_ExtMode_NonExtendable, 4, 255, 0,
};
static const upb_MiniTable *messages_layout[27] = {

@ -227,7 +227,7 @@ UPB_INLINE void* upb_Arena_Realloc(upb_Arena* a, void* ptr, size_t oldsize,
size_t size) {
_upb_ArenaHead* h = (_upb_ArenaHead*)a;
char* ch_ptr = (char*)ptr;
oldsize = UPB_ALIGN_MALLOC(size);
oldsize = UPB_ALIGN_MALLOC(oldsize);
size = UPB_ALIGN_MALLOC(size);
if (ch_ptr + oldsize == h->ptr) {
if ((size_t)(h->end - ch_ptr) >= size) {

@ -1431,11 +1431,11 @@ void WriteMessage(const protobuf::Descriptor* message, const FileLayout& layout,
FieldNumberOrder(message);
assert(field_number_order.size() == mt_32->field_count);
assert(field_number_order.size() == mt_64->field_count);
if (!field_number_order.empty()) {
if (mt_64->field_count > 0) {
std::string fields_array_name = msg_name + "__fields";
fields_array_ref = "&" + fields_array_name + "[0]";
output("static const upb_MiniTable_Field $0[$1] = {\n", fields_array_name,
field_number_order.size());
mt_64->field_count());
for (int i = 0; i < static_cast<int>(field_number_order.size()); i++) {
auto field = field_number_order[i];
int sublayout_index = 0;

Loading…
Cancel
Save