From 485b96466257a972042b49f45cb79bc0d1093748 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Thu, 2 Jul 2009 23:27:31 -0700 Subject: Bugfixes. --- descriptor.c | 376 ++++++++++++++++++++++------------------------------------ test_table.cc | 21 +++- upb.h | 5 + upb_context.c | 13 +- upb_msg.c | 1 + upb_parse.c | 4 +- upb_table.c | 1 + 7 files changed, 182 insertions(+), 239 deletions(-) diff --git a/descriptor.c b/descriptor.c index f60573b..d90f6c8 100644 --- a/descriptor.c +++ b/descriptor.c @@ -8,22 +8,22 @@ static struct upb_string google_protobuf_filedescriptor_package = { .byte_len=15, .ptr="google.protobuf" }; -struct google_protobuf_DescriptorProto google_protobuf_FileDescriptorSet_descriptor; -struct google_protobuf_DescriptorProto google_protobuf_FileDescriptorProto_descriptor; -struct google_protobuf_DescriptorProto google_protobuf_DescriptorProto_descriptor; -struct google_protobuf_DescriptorProto google_protobuf_FieldDescriptorProto_descriptor; -struct google_protobuf_DescriptorProto google_protobuf_EnumDescriptorProto_descriptor; -struct google_protobuf_DescriptorProto google_protobuf_EnumValueDescriptorProto_descriptor; -struct google_protobuf_DescriptorProto google_protobuf_ServiceDescriptorProto_descriptor; -struct google_protobuf_DescriptorProto google_protobuf_MethodDescriptorProto_descriptor; -struct google_protobuf_DescriptorProto google_protobuf_FileOptions_descriptor; -struct google_protobuf_DescriptorProto google_protobuf_MessageOptions_descriptor; -struct google_protobuf_DescriptorProto google_protobuf_FieldOptions_descriptor; -struct google_protobuf_DescriptorProto google_protobuf_EnumOptions_descriptor; -struct google_protobuf_DescriptorProto google_protobuf_EnumValueOptions_descriptor; -struct google_protobuf_DescriptorProto google_protobuf_ServiceOptions_descriptor; -struct google_protobuf_DescriptorProto google_protobuf_MethodOptions_descriptor; -struct google_protobuf_DescriptorProto google_protobuf_UninterpretedOption_descriptor; +extern struct google_protobuf_DescriptorProto google_protobuf_FileDescriptorSet_descriptor; +extern struct google_protobuf_DescriptorProto google_protobuf_FileDescriptorProto_descriptor; +extern struct google_protobuf_DescriptorProto google_protobuf_DescriptorProto_descriptor; +extern struct google_protobuf_DescriptorProto google_protobuf_FieldDescriptorProto_descriptor; +extern struct google_protobuf_DescriptorProto google_protobuf_EnumDescriptorProto_descriptor; +extern struct google_protobuf_DescriptorProto google_protobuf_EnumValueDescriptorProto_descriptor; +extern struct google_protobuf_DescriptorProto google_protobuf_ServiceDescriptorProto_descriptor; +extern struct google_protobuf_DescriptorProto google_protobuf_MethodDescriptorProto_descriptor; +extern struct google_protobuf_DescriptorProto google_protobuf_FileOptions_descriptor; +extern struct google_protobuf_DescriptorProto google_protobuf_MessageOptions_descriptor; +extern struct google_protobuf_DescriptorProto google_protobuf_FieldOptions_descriptor; +extern struct google_protobuf_DescriptorProto google_protobuf_EnumOptions_descriptor; +extern struct google_protobuf_DescriptorProto google_protobuf_EnumValueOptions_descriptor; +extern struct google_protobuf_DescriptorProto google_protobuf_ServiceOptions_descriptor; +extern struct google_protobuf_DescriptorProto google_protobuf_MethodOptions_descriptor; +extern struct google_protobuf_DescriptorProto google_protobuf_UninterpretedOption_descriptor; static google_protobuf_DescriptorProto *google_protobuf_filedescriptor_message_type_array[] = { &google_protobuf_FileDescriptorSet_descriptor, @@ -70,7 +70,7 @@ static struct upb_string google_protobuf_FileDescriptorSet_descriptor_name = { .byte_len=17, .ptr="FileDescriptorSet" }; -struct google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorSet_file_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorSet_file_descriptor; static google_protobuf_FieldDescriptorProto *google_protobuf_FileDescriptorSet_descriptor_field_array[] = { &google_protobuf_FileDescriptorSet_file_descriptor, @@ -85,7 +85,6 @@ google_protobuf_DescriptorProto google_protobuf_FileDescriptorSet_descriptor = { .field = &google_protobuf_FileDescriptorSet_descriptor_field, .nested_type = NULL, .enum_type = NULL, - .extension_range = NULL, }; static struct upb_string google_protobuf_FileDescriptorSet_file_fieldname = { .byte_len=4, .ptr="file" @@ -95,7 +94,7 @@ static struct upb_string google_protobuf_FileDescriptorSet_file_field_typename = .byte_len=19, .ptr="FileDescriptorProto" }; -google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorSet_file = { +google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorSet_file_descriptor = { .name = &google_protobuf_FileDescriptorSet_file_fieldname, .number = (uint32_t)1, .label = 3, @@ -107,14 +106,14 @@ static struct upb_string google_protobuf_FileDescriptorProto_descriptor_name = { .byte_len=19, .ptr="FileDescriptorProto" }; -struct google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_name_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_package_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_dependency_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_message_type_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_enum_type_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_service_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_extension_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_options_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_name_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_package_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_dependency_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_message_type_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_enum_type_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_service_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_extension_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_options_descriptor; static google_protobuf_FieldDescriptorProto *google_protobuf_FileDescriptorProto_descriptor_field_array[] = { &google_protobuf_FileDescriptorProto_name_descriptor, @@ -136,13 +135,12 @@ google_protobuf_DescriptorProto google_protobuf_FileDescriptorProto_descriptor = .field = &google_protobuf_FileDescriptorProto_descriptor_field, .nested_type = NULL, .enum_type = NULL, - .extension_range = NULL, }; static struct upb_string google_protobuf_FileDescriptorProto_name_fieldname = { .byte_len=4, .ptr="name" }; -google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_name = { +google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_name_descriptor = { .name = &google_protobuf_FileDescriptorProto_name_fieldname, .number = (uint32_t)1, .label = 1, @@ -153,7 +151,7 @@ static struct upb_string google_protobuf_FileDescriptorProto_package_fieldname = .byte_len=7, .ptr="package" }; -google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_package = { +google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_package_descriptor = { .name = &google_protobuf_FileDescriptorProto_package_fieldname, .number = (uint32_t)2, .label = 1, @@ -164,7 +162,7 @@ static struct upb_string google_protobuf_FileDescriptorProto_dependency_fieldnam .byte_len=10, .ptr="dependency" }; -google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_dependency = { +google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_dependency_descriptor = { .name = &google_protobuf_FileDescriptorProto_dependency_fieldname, .number = (uint32_t)3, .label = 3, @@ -179,7 +177,7 @@ static struct upb_string google_protobuf_FileDescriptorProto_message_type_field_ .byte_len=15, .ptr="DescriptorProto" }; -google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_message_type = { +google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_message_type_descriptor = { .name = &google_protobuf_FileDescriptorProto_message_type_fieldname, .number = (uint32_t)4, .label = 3, @@ -194,7 +192,7 @@ static struct upb_string google_protobuf_FileDescriptorProto_enum_type_field_typ .byte_len=19, .ptr="EnumDescriptorProto" }; -google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_enum_type = { +google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_enum_type_descriptor = { .name = &google_protobuf_FileDescriptorProto_enum_type_fieldname, .number = (uint32_t)5, .label = 3, @@ -209,7 +207,7 @@ static struct upb_string google_protobuf_FileDescriptorProto_service_field_typen .byte_len=22, .ptr="ServiceDescriptorProto" }; -google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_service = { +google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_service_descriptor = { .name = &google_protobuf_FileDescriptorProto_service_fieldname, .number = (uint32_t)6, .label = 3, @@ -224,7 +222,7 @@ static struct upb_string google_protobuf_FileDescriptorProto_extension_field_typ .byte_len=20, .ptr="FieldDescriptorProto" }; -google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_extension = { +google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_extension_descriptor = { .name = &google_protobuf_FileDescriptorProto_extension_fieldname, .number = (uint32_t)7, .label = 3, @@ -239,7 +237,7 @@ static struct upb_string google_protobuf_FileDescriptorProto_options_field_typen .byte_len=11, .ptr="FileOptions" }; -google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_options = { +google_protobuf_FieldDescriptorProto google_protobuf_FileDescriptorProto_options_descriptor = { .name = &google_protobuf_FileDescriptorProto_options_fieldname, .number = (uint32_t)8, .label = 1, @@ -251,13 +249,13 @@ static struct upb_string google_protobuf_DescriptorProto_descriptor_name = { .byte_len=15, .ptr="DescriptorProto" }; -struct google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_name_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_field_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_extension_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_nested_type_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_enum_type_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_extension_range_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_options_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_name_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_field_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_extension_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_nested_type_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_enum_type_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_extension_range_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_options_descriptor; static google_protobuf_FieldDescriptorProto *google_protobuf_DescriptorProto_descriptor_field_array[] = { &google_protobuf_DescriptorProto_name_descriptor, @@ -273,7 +271,7 @@ static UPB_MSG_ARRAY(google_protobuf_FieldDescriptorProto) google_protobuf_Descr .len=7, .elements=google_protobuf_DescriptorProto_descriptor_field_array }; -struct google_protobuf_DescriptorProto google_protobuf_DescriptorProto_ExtensionRange_descriptor; +extern struct google_protobuf_DescriptorProto google_protobuf_DescriptorProto_ExtensionRange_descriptor; static google_protobuf_DescriptorProto *google_protobuf_DescriptorProto_descriptor_nested_type_array[] = { &google_protobuf_DescriptorProto_ExtensionRange_descriptor, @@ -288,13 +286,12 @@ google_protobuf_DescriptorProto google_protobuf_DescriptorProto_descriptor = { .field = &google_protobuf_DescriptorProto_descriptor_field, .nested_type = &google_protobuf_DescriptorProto_descriptor_nested_type, .enum_type = NULL, - .extension_range = NULL, }; static struct upb_string google_protobuf_DescriptorProto_name_fieldname = { .byte_len=4, .ptr="name" }; -google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_name = { +google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_name_descriptor = { .name = &google_protobuf_DescriptorProto_name_fieldname, .number = (uint32_t)1, .label = 1, @@ -309,7 +306,7 @@ static struct upb_string google_protobuf_DescriptorProto_field_field_typename = .byte_len=20, .ptr="FieldDescriptorProto" }; -google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_field = { +google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_field_descriptor = { .name = &google_protobuf_DescriptorProto_field_fieldname, .number = (uint32_t)2, .label = 3, @@ -324,7 +321,7 @@ static struct upb_string google_protobuf_DescriptorProto_extension_field_typenam .byte_len=20, .ptr="FieldDescriptorProto" }; -google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_extension = { +google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_extension_descriptor = { .name = &google_protobuf_DescriptorProto_extension_fieldname, .number = (uint32_t)6, .label = 3, @@ -339,7 +336,7 @@ static struct upb_string google_protobuf_DescriptorProto_nested_type_field_typen .byte_len=15, .ptr="DescriptorProto" }; -google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_nested_type = { +google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_nested_type_descriptor = { .name = &google_protobuf_DescriptorProto_nested_type_fieldname, .number = (uint32_t)3, .label = 3, @@ -354,7 +351,7 @@ static struct upb_string google_protobuf_DescriptorProto_enum_type_field_typenam .byte_len=19, .ptr="EnumDescriptorProto" }; -google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_enum_type = { +google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_enum_type_descriptor = { .name = &google_protobuf_DescriptorProto_enum_type_fieldname, .number = (uint32_t)4, .label = 3, @@ -369,7 +366,7 @@ static struct upb_string google_protobuf_DescriptorProto_extension_range_field_t .byte_len=14, .ptr="ExtensionRange" }; -google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_extension_range = { +google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_extension_range_descriptor = { .name = &google_protobuf_DescriptorProto_extension_range_fieldname, .number = (uint32_t)5, .label = 3, @@ -384,7 +381,7 @@ static struct upb_string google_protobuf_DescriptorProto_options_field_typename .byte_len=14, .ptr="MessageOptions" }; -google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_options = { +google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_options_descriptor = { .name = &google_protobuf_DescriptorProto_options_fieldname, .number = (uint32_t)7, .label = 1, @@ -396,8 +393,8 @@ static struct upb_string google_protobuf_DescriptorProto_ExtensionRange_descript .byte_len=14, .ptr="ExtensionRange" }; -struct google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_ExtensionRange_start_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_ExtensionRange_end_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_ExtensionRange_start_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_ExtensionRange_end_descriptor; static google_protobuf_FieldDescriptorProto *google_protobuf_DescriptorProto_ExtensionRange_descriptor_field_array[] = { &google_protobuf_DescriptorProto_ExtensionRange_start_descriptor, @@ -413,13 +410,12 @@ google_protobuf_DescriptorProto google_protobuf_DescriptorProto_ExtensionRange_d .field = &google_protobuf_DescriptorProto_ExtensionRange_descriptor_field, .nested_type = NULL, .enum_type = NULL, - .extension_range = NULL, }; static struct upb_string google_protobuf_DescriptorProto_ExtensionRange_start_fieldname = { .byte_len=5, .ptr="start" }; -google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_ExtensionRange_start = { +google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_ExtensionRange_start_descriptor = { .name = &google_protobuf_DescriptorProto_ExtensionRange_start_fieldname, .number = (uint32_t)1, .label = 1, @@ -430,7 +426,7 @@ static struct upb_string google_protobuf_DescriptorProto_ExtensionRange_end_fiel .byte_len=3, .ptr="end" }; -google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_ExtensionRange_end = { +google_protobuf_FieldDescriptorProto google_protobuf_DescriptorProto_ExtensionRange_end_descriptor = { .name = &google_protobuf_DescriptorProto_ExtensionRange_end_fieldname, .number = (uint32_t)2, .label = 1, @@ -442,14 +438,14 @@ static struct upb_string google_protobuf_FieldDescriptorProto_descriptor_name = .byte_len=20, .ptr="FieldDescriptorProto" }; -struct google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_name_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_number_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_label_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_type_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_type_name_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_extendee_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_default_value_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_options_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_name_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_number_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_label_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_type_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_type_name_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_extendee_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_default_value_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_options_descriptor; static google_protobuf_FieldDescriptorProto *google_protobuf_FieldDescriptorProto_descriptor_field_array[] = { &google_protobuf_FieldDescriptorProto_name_descriptor, @@ -466,8 +462,8 @@ static UPB_MSG_ARRAY(google_protobuf_FieldDescriptorProto) google_protobuf_Field .len=8, .elements=google_protobuf_FieldDescriptorProto_descriptor_field_array }; -struct google_protobuf_EnumDescriptorProto google_protobuf_FieldDescriptorProto_Type_descriptor; -struct google_protobuf_EnumDescriptorProto google_protobuf_FieldDescriptorProto_Label_descriptor; +extern struct google_protobuf_EnumDescriptorProto google_protobuf_FieldDescriptorProto_Type_descriptor; +extern struct google_protobuf_EnumDescriptorProto google_protobuf_FieldDescriptorProto_Label_descriptor; static google_protobuf_EnumDescriptorProto *google_protobuf_FieldDescriptorProto_descriptor_enum_type_array[] = { &google_protobuf_FieldDescriptorProto_Type_descriptor, @@ -483,13 +479,12 @@ google_protobuf_DescriptorProto google_protobuf_FieldDescriptorProto_descriptor .field = &google_protobuf_FieldDescriptorProto_descriptor_field, .nested_type = NULL, .enum_type = &google_protobuf_FieldDescriptorProto_descriptor_enum_type, - .extension_range = NULL, }; static struct upb_string google_protobuf_FieldDescriptorProto_name_fieldname = { .byte_len=4, .ptr="name" }; -google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_name = { +google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_name_descriptor = { .name = &google_protobuf_FieldDescriptorProto_name_fieldname, .number = (uint32_t)1, .label = 1, @@ -500,7 +495,7 @@ static struct upb_string google_protobuf_FieldDescriptorProto_number_fieldname = .byte_len=6, .ptr="number" }; -google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_number = { +google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_number_descriptor = { .name = &google_protobuf_FieldDescriptorProto_number_fieldname, .number = (uint32_t)3, .label = 1, @@ -515,7 +510,7 @@ static struct upb_string google_protobuf_FieldDescriptorProto_label_field_typena .byte_len=5, .ptr="Label" }; -google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_label = { +google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_label_descriptor = { .name = &google_protobuf_FieldDescriptorProto_label_fieldname, .number = (uint32_t)4, .label = 1, @@ -530,7 +525,7 @@ static struct upb_string google_protobuf_FieldDescriptorProto_type_field_typenam .byte_len=4, .ptr="Type" }; -google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_type = { +google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_type_descriptor = { .name = &google_protobuf_FieldDescriptorProto_type_fieldname, .number = (uint32_t)5, .label = 1, @@ -541,7 +536,7 @@ static struct upb_string google_protobuf_FieldDescriptorProto_type_name_fieldnam .byte_len=9, .ptr="type_name" }; -google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_type_name = { +google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_type_name_descriptor = { .name = &google_protobuf_FieldDescriptorProto_type_name_fieldname, .number = (uint32_t)6, .label = 1, @@ -552,7 +547,7 @@ static struct upb_string google_protobuf_FieldDescriptorProto_extendee_fieldname .byte_len=8, .ptr="extendee" }; -google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_extendee = { +google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_extendee_descriptor = { .name = &google_protobuf_FieldDescriptorProto_extendee_fieldname, .number = (uint32_t)2, .label = 1, @@ -563,7 +558,7 @@ static struct upb_string google_protobuf_FieldDescriptorProto_default_value_fiel .byte_len=13, .ptr="default_value" }; -google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_default_value = { +google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_default_value_descriptor = { .name = &google_protobuf_FieldDescriptorProto_default_value_fieldname, .number = (uint32_t)7, .label = 1, @@ -578,7 +573,7 @@ static struct upb_string google_protobuf_FieldDescriptorProto_options_field_type .byte_len=12, .ptr="FieldOptions" }; -google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_options = { +google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_options_descriptor = { .name = &google_protobuf_FieldDescriptorProto_options_fieldname, .number = (uint32_t)8, .label = 1, @@ -604,9 +599,9 @@ static struct upb_string google_protobuf_EnumDescriptorProto_descriptor_name = { .byte_len=19, .ptr="EnumDescriptorProto" }; -struct google_protobuf_FieldDescriptorProto google_protobuf_EnumDescriptorProto_name_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_EnumDescriptorProto_value_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_EnumDescriptorProto_options_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_EnumDescriptorProto_name_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_EnumDescriptorProto_value_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_EnumDescriptorProto_options_descriptor; static google_protobuf_FieldDescriptorProto *google_protobuf_EnumDescriptorProto_descriptor_field_array[] = { &google_protobuf_EnumDescriptorProto_name_descriptor, @@ -623,13 +618,12 @@ google_protobuf_DescriptorProto google_protobuf_EnumDescriptorProto_descriptor = .field = &google_protobuf_EnumDescriptorProto_descriptor_field, .nested_type = NULL, .enum_type = NULL, - .extension_range = NULL, }; static struct upb_string google_protobuf_EnumDescriptorProto_name_fieldname = { .byte_len=4, .ptr="name" }; -google_protobuf_FieldDescriptorProto google_protobuf_EnumDescriptorProto_name = { +google_protobuf_FieldDescriptorProto google_protobuf_EnumDescriptorProto_name_descriptor = { .name = &google_protobuf_EnumDescriptorProto_name_fieldname, .number = (uint32_t)1, .label = 1, @@ -644,7 +638,7 @@ static struct upb_string google_protobuf_EnumDescriptorProto_value_field_typenam .byte_len=24, .ptr="EnumValueDescriptorProto" }; -google_protobuf_FieldDescriptorProto google_protobuf_EnumDescriptorProto_value = { +google_protobuf_FieldDescriptorProto google_protobuf_EnumDescriptorProto_value_descriptor = { .name = &google_protobuf_EnumDescriptorProto_value_fieldname, .number = (uint32_t)2, .label = 3, @@ -659,7 +653,7 @@ static struct upb_string google_protobuf_EnumDescriptorProto_options_field_typen .byte_len=11, .ptr="EnumOptions" }; -google_protobuf_FieldDescriptorProto google_protobuf_EnumDescriptorProto_options = { +google_protobuf_FieldDescriptorProto google_protobuf_EnumDescriptorProto_options_descriptor = { .name = &google_protobuf_EnumDescriptorProto_options_fieldname, .number = (uint32_t)3, .label = 1, @@ -671,9 +665,9 @@ static struct upb_string google_protobuf_EnumValueDescriptorProto_descriptor_nam .byte_len=24, .ptr="EnumValueDescriptorProto" }; -struct google_protobuf_FieldDescriptorProto google_protobuf_EnumValueDescriptorProto_name_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_EnumValueDescriptorProto_number_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_EnumValueDescriptorProto_options_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_EnumValueDescriptorProto_name_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_EnumValueDescriptorProto_number_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_EnumValueDescriptorProto_options_descriptor; static google_protobuf_FieldDescriptorProto *google_protobuf_EnumValueDescriptorProto_descriptor_field_array[] = { &google_protobuf_EnumValueDescriptorProto_name_descriptor, @@ -690,13 +684,12 @@ google_protobuf_DescriptorProto google_protobuf_EnumValueDescriptorProto_descrip .field = &google_protobuf_EnumValueDescriptorProto_descriptor_field, .nested_type = NULL, .enum_type = NULL, - .extension_range = NULL, }; static struct upb_string google_protobuf_EnumValueDescriptorProto_name_fieldname = { .byte_len=4, .ptr="name" }; -google_protobuf_FieldDescriptorProto google_protobuf_EnumValueDescriptorProto_name = { +google_protobuf_FieldDescriptorProto google_protobuf_EnumValueDescriptorProto_name_descriptor = { .name = &google_protobuf_EnumValueDescriptorProto_name_fieldname, .number = (uint32_t)1, .label = 1, @@ -707,7 +700,7 @@ static struct upb_string google_protobuf_EnumValueDescriptorProto_number_fieldna .byte_len=6, .ptr="number" }; -google_protobuf_FieldDescriptorProto google_protobuf_EnumValueDescriptorProto_number = { +google_protobuf_FieldDescriptorProto google_protobuf_EnumValueDescriptorProto_number_descriptor = { .name = &google_protobuf_EnumValueDescriptorProto_number_fieldname, .number = (uint32_t)2, .label = 1, @@ -722,7 +715,7 @@ static struct upb_string google_protobuf_EnumValueDescriptorProto_options_field_ .byte_len=16, .ptr="EnumValueOptions" }; -google_protobuf_FieldDescriptorProto google_protobuf_EnumValueDescriptorProto_options = { +google_protobuf_FieldDescriptorProto google_protobuf_EnumValueDescriptorProto_options_descriptor = { .name = &google_protobuf_EnumValueDescriptorProto_options_fieldname, .number = (uint32_t)3, .label = 1, @@ -734,9 +727,9 @@ static struct upb_string google_protobuf_ServiceDescriptorProto_descriptor_name .byte_len=22, .ptr="ServiceDescriptorProto" }; -struct google_protobuf_FieldDescriptorProto google_protobuf_ServiceDescriptorProto_name_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_ServiceDescriptorProto_method_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_ServiceDescriptorProto_options_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_ServiceDescriptorProto_name_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_ServiceDescriptorProto_method_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_ServiceDescriptorProto_options_descriptor; static google_protobuf_FieldDescriptorProto *google_protobuf_ServiceDescriptorProto_descriptor_field_array[] = { &google_protobuf_ServiceDescriptorProto_name_descriptor, @@ -753,13 +746,12 @@ google_protobuf_DescriptorProto google_protobuf_ServiceDescriptorProto_descripto .field = &google_protobuf_ServiceDescriptorProto_descriptor_field, .nested_type = NULL, .enum_type = NULL, - .extension_range = NULL, }; static struct upb_string google_protobuf_ServiceDescriptorProto_name_fieldname = { .byte_len=4, .ptr="name" }; -google_protobuf_FieldDescriptorProto google_protobuf_ServiceDescriptorProto_name = { +google_protobuf_FieldDescriptorProto google_protobuf_ServiceDescriptorProto_name_descriptor = { .name = &google_protobuf_ServiceDescriptorProto_name_fieldname, .number = (uint32_t)1, .label = 1, @@ -774,7 +766,7 @@ static struct upb_string google_protobuf_ServiceDescriptorProto_method_field_typ .byte_len=21, .ptr="MethodDescriptorProto" }; -google_protobuf_FieldDescriptorProto google_protobuf_ServiceDescriptorProto_method = { +google_protobuf_FieldDescriptorProto google_protobuf_ServiceDescriptorProto_method_descriptor = { .name = &google_protobuf_ServiceDescriptorProto_method_fieldname, .number = (uint32_t)2, .label = 3, @@ -789,7 +781,7 @@ static struct upb_string google_protobuf_ServiceDescriptorProto_options_field_ty .byte_len=14, .ptr="ServiceOptions" }; -google_protobuf_FieldDescriptorProto google_protobuf_ServiceDescriptorProto_options = { +google_protobuf_FieldDescriptorProto google_protobuf_ServiceDescriptorProto_options_descriptor = { .name = &google_protobuf_ServiceDescriptorProto_options_fieldname, .number = (uint32_t)3, .label = 1, @@ -801,10 +793,10 @@ static struct upb_string google_protobuf_MethodDescriptorProto_descriptor_name = .byte_len=21, .ptr="MethodDescriptorProto" }; -struct google_protobuf_FieldDescriptorProto google_protobuf_MethodDescriptorProto_name_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_MethodDescriptorProto_input_type_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_MethodDescriptorProto_output_type_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_MethodDescriptorProto_options_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_MethodDescriptorProto_name_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_MethodDescriptorProto_input_type_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_MethodDescriptorProto_output_type_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_MethodDescriptorProto_options_descriptor; static google_protobuf_FieldDescriptorProto *google_protobuf_MethodDescriptorProto_descriptor_field_array[] = { &google_protobuf_MethodDescriptorProto_name_descriptor, @@ -822,13 +814,12 @@ google_protobuf_DescriptorProto google_protobuf_MethodDescriptorProto_descriptor .field = &google_protobuf_MethodDescriptorProto_descriptor_field, .nested_type = NULL, .enum_type = NULL, - .extension_range = NULL, }; static struct upb_string google_protobuf_MethodDescriptorProto_name_fieldname = { .byte_len=4, .ptr="name" }; -google_protobuf_FieldDescriptorProto google_protobuf_MethodDescriptorProto_name = { +google_protobuf_FieldDescriptorProto google_protobuf_MethodDescriptorProto_name_descriptor = { .name = &google_protobuf_MethodDescriptorProto_name_fieldname, .number = (uint32_t)1, .label = 1, @@ -839,7 +830,7 @@ static struct upb_string google_protobuf_MethodDescriptorProto_input_type_fieldn .byte_len=10, .ptr="input_type" }; -google_protobuf_FieldDescriptorProto google_protobuf_MethodDescriptorProto_input_type = { +google_protobuf_FieldDescriptorProto google_protobuf_MethodDescriptorProto_input_type_descriptor = { .name = &google_protobuf_MethodDescriptorProto_input_type_fieldname, .number = (uint32_t)2, .label = 1, @@ -850,7 +841,7 @@ static struct upb_string google_protobuf_MethodDescriptorProto_output_type_field .byte_len=11, .ptr="output_type" }; -google_protobuf_FieldDescriptorProto google_protobuf_MethodDescriptorProto_output_type = { +google_protobuf_FieldDescriptorProto google_protobuf_MethodDescriptorProto_output_type_descriptor = { .name = &google_protobuf_MethodDescriptorProto_output_type_fieldname, .number = (uint32_t)3, .label = 1, @@ -865,7 +856,7 @@ static struct upb_string google_protobuf_MethodDescriptorProto_options_field_typ .byte_len=13, .ptr="MethodOptions" }; -google_protobuf_FieldDescriptorProto google_protobuf_MethodDescriptorProto_options = { +google_protobuf_FieldDescriptorProto google_protobuf_MethodDescriptorProto_options_descriptor = { .name = &google_protobuf_MethodDescriptorProto_options_fieldname, .number = (uint32_t)4, .label = 1, @@ -877,11 +868,11 @@ static struct upb_string google_protobuf_FileOptions_descriptor_name = { .byte_len=11, .ptr="FileOptions" }; -struct google_protobuf_FieldDescriptorProto google_protobuf_FileOptions_java_package_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_FileOptions_java_outer_classname_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_FileOptions_java_multiple_files_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_FileOptions_optimize_for_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_FileOptions_uninterpreted_option_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_FileOptions_java_package_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_FileOptions_java_outer_classname_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_FileOptions_java_multiple_files_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_FileOptions_optimize_for_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_FileOptions_uninterpreted_option_descriptor; static google_protobuf_FieldDescriptorProto *google_protobuf_FileOptions_descriptor_field_array[] = { &google_protobuf_FileOptions_java_package_descriptor, @@ -895,7 +886,7 @@ static UPB_MSG_ARRAY(google_protobuf_FieldDescriptorProto) google_protobuf_FileO .len=5, .elements=google_protobuf_FileOptions_descriptor_field_array }; -struct google_protobuf_EnumDescriptorProto google_protobuf_FileOptions_OptimizeMode_descriptor; +extern struct google_protobuf_EnumDescriptorProto google_protobuf_FileOptions_OptimizeMode_descriptor; static google_protobuf_EnumDescriptorProto *google_protobuf_FileOptions_descriptor_enum_type_array[] = { &google_protobuf_FileOptions_OptimizeMode_descriptor, @@ -905,28 +896,17 @@ static UPB_MSG_ARRAY(google_protobuf_EnumDescriptorProto) google_protobuf_FileOp .len=1, .elements=google_protobuf_FileOptions_descriptor_enum_type_array }; -struct google_protobuf_DescriptorProto_ExtensionRange google_protobuf_FileOptions_descriptor_extension_range0_descriptor; - -static google_protobuf_DescriptorProto_ExtensionRange *google_protobuf_FileOptions_descriptor_extension_range_array[] = { - &google_protobuf_FileOptions_descriptor_extension_range0_descriptor, -}; - -static UPB_MSG_ARRAY(google_protobuf_DescriptorProto_ExtensionRange) google_protobuf_FileOptions_descriptor_extension_range = { - .len=1, .elements=google_protobuf_FileOptions_descriptor_extension_range_array -}; - google_protobuf_DescriptorProto google_protobuf_FileOptions_descriptor = { .name = &google_protobuf_FileOptions_descriptor_name, .field = &google_protobuf_FileOptions_descriptor_field, .nested_type = NULL, .enum_type = &google_protobuf_FileOptions_descriptor_enum_type, - .extension_range = &google_protobuf_FileOptions_descriptor_extension_range, }; static struct upb_string google_protobuf_FileOptions_java_package_fieldname = { .byte_len=12, .ptr="java_package" }; -google_protobuf_FieldDescriptorProto google_protobuf_FileOptions_java_package = { +google_protobuf_FieldDescriptorProto google_protobuf_FileOptions_java_package_descriptor = { .name = &google_protobuf_FileOptions_java_package_fieldname, .number = (uint32_t)1, .label = 1, @@ -937,7 +917,7 @@ static struct upb_string google_protobuf_FileOptions_java_outer_classname_fieldn .byte_len=20, .ptr="java_outer_classname" }; -google_protobuf_FieldDescriptorProto google_protobuf_FileOptions_java_outer_classname = { +google_protobuf_FieldDescriptorProto google_protobuf_FileOptions_java_outer_classname_descriptor = { .name = &google_protobuf_FileOptions_java_outer_classname_fieldname, .number = (uint32_t)8, .label = 1, @@ -948,7 +928,7 @@ static struct upb_string google_protobuf_FileOptions_java_multiple_files_fieldna .byte_len=19, .ptr="java_multiple_files" }; -google_protobuf_FieldDescriptorProto google_protobuf_FileOptions_java_multiple_files = { +google_protobuf_FieldDescriptorProto google_protobuf_FileOptions_java_multiple_files_descriptor = { .name = &google_protobuf_FileOptions_java_multiple_files_fieldname, .number = (uint32_t)10, .label = 1, @@ -963,7 +943,7 @@ static struct upb_string google_protobuf_FileOptions_optimize_for_field_typename .byte_len=12, .ptr="OptimizeMode" }; -google_protobuf_FieldDescriptorProto google_protobuf_FileOptions_optimize_for = { +google_protobuf_FieldDescriptorProto google_protobuf_FileOptions_optimize_for_descriptor = { .name = &google_protobuf_FileOptions_optimize_for_fieldname, .number = (uint32_t)9, .label = 1, @@ -978,7 +958,7 @@ static struct upb_string google_protobuf_FileOptions_uninterpreted_option_field_ .byte_len=19, .ptr="UninterpretedOption" }; -google_protobuf_FieldDescriptorProto google_protobuf_FileOptions_uninterpreted_option = { +google_protobuf_FieldDescriptorProto google_protobuf_FileOptions_uninterpreted_option_descriptor = { .name = &google_protobuf_FileOptions_uninterpreted_option_fieldname, .number = (uint32_t)999, .label = 3, @@ -997,8 +977,8 @@ static struct upb_string google_protobuf_MessageOptions_descriptor_name = { .byte_len=14, .ptr="MessageOptions" }; -struct google_protobuf_FieldDescriptorProto google_protobuf_MessageOptions_message_set_wire_format_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_MessageOptions_uninterpreted_option_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_MessageOptions_message_set_wire_format_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_MessageOptions_uninterpreted_option_descriptor; static google_protobuf_FieldDescriptorProto *google_protobuf_MessageOptions_descriptor_field_array[] = { &google_protobuf_MessageOptions_message_set_wire_format_descriptor, @@ -1009,28 +989,17 @@ static UPB_MSG_ARRAY(google_protobuf_FieldDescriptorProto) google_protobuf_Messa .len=2, .elements=google_protobuf_MessageOptions_descriptor_field_array }; -struct google_protobuf_DescriptorProto_ExtensionRange google_protobuf_MessageOptions_descriptor_extension_range0_descriptor; - -static google_protobuf_DescriptorProto_ExtensionRange *google_protobuf_MessageOptions_descriptor_extension_range_array[] = { - &google_protobuf_MessageOptions_descriptor_extension_range0_descriptor, -}; - -static UPB_MSG_ARRAY(google_protobuf_DescriptorProto_ExtensionRange) google_protobuf_MessageOptions_descriptor_extension_range = { - .len=1, .elements=google_protobuf_MessageOptions_descriptor_extension_range_array -}; - google_protobuf_DescriptorProto google_protobuf_MessageOptions_descriptor = { .name = &google_protobuf_MessageOptions_descriptor_name, .field = &google_protobuf_MessageOptions_descriptor_field, .nested_type = NULL, .enum_type = NULL, - .extension_range = &google_protobuf_MessageOptions_descriptor_extension_range, }; static struct upb_string google_protobuf_MessageOptions_message_set_wire_format_fieldname = { .byte_len=23, .ptr="message_set_wire_format" }; -google_protobuf_FieldDescriptorProto google_protobuf_MessageOptions_message_set_wire_format = { +google_protobuf_FieldDescriptorProto google_protobuf_MessageOptions_message_set_wire_format_descriptor = { .name = &google_protobuf_MessageOptions_message_set_wire_format_fieldname, .number = (uint32_t)1, .label = 1, @@ -1045,7 +1014,7 @@ static struct upb_string google_protobuf_MessageOptions_uninterpreted_option_fie .byte_len=19, .ptr="UninterpretedOption" }; -google_protobuf_FieldDescriptorProto google_protobuf_MessageOptions_uninterpreted_option = { +google_protobuf_FieldDescriptorProto google_protobuf_MessageOptions_uninterpreted_option_descriptor = { .name = &google_protobuf_MessageOptions_uninterpreted_option_fieldname, .number = (uint32_t)999, .label = 3, @@ -1057,9 +1026,9 @@ static struct upb_string google_protobuf_FieldOptions_descriptor_name = { .byte_len=12, .ptr="FieldOptions" }; -struct google_protobuf_FieldDescriptorProto google_protobuf_FieldOptions_ctype_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_FieldOptions_experimental_map_key_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_FieldOptions_uninterpreted_option_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_FieldOptions_ctype_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_FieldOptions_experimental_map_key_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_FieldOptions_uninterpreted_option_descriptor; static google_protobuf_FieldDescriptorProto *google_protobuf_FieldOptions_descriptor_field_array[] = { &google_protobuf_FieldOptions_ctype_descriptor, @@ -1071,7 +1040,7 @@ static UPB_MSG_ARRAY(google_protobuf_FieldDescriptorProto) google_protobuf_Field .len=3, .elements=google_protobuf_FieldOptions_descriptor_field_array }; -struct google_protobuf_EnumDescriptorProto google_protobuf_FieldOptions_CType_descriptor; +extern struct google_protobuf_EnumDescriptorProto google_protobuf_FieldOptions_CType_descriptor; static google_protobuf_EnumDescriptorProto *google_protobuf_FieldOptions_descriptor_enum_type_array[] = { &google_protobuf_FieldOptions_CType_descriptor, @@ -1081,22 +1050,11 @@ static UPB_MSG_ARRAY(google_protobuf_EnumDescriptorProto) google_protobuf_FieldO .len=1, .elements=google_protobuf_FieldOptions_descriptor_enum_type_array }; -struct google_protobuf_DescriptorProto_ExtensionRange google_protobuf_FieldOptions_descriptor_extension_range0_descriptor; - -static google_protobuf_DescriptorProto_ExtensionRange *google_protobuf_FieldOptions_descriptor_extension_range_array[] = { - &google_protobuf_FieldOptions_descriptor_extension_range0_descriptor, -}; - -static UPB_MSG_ARRAY(google_protobuf_DescriptorProto_ExtensionRange) google_protobuf_FieldOptions_descriptor_extension_range = { - .len=1, .elements=google_protobuf_FieldOptions_descriptor_extension_range_array -}; - google_protobuf_DescriptorProto google_protobuf_FieldOptions_descriptor = { .name = &google_protobuf_FieldOptions_descriptor_name, .field = &google_protobuf_FieldOptions_descriptor_field, .nested_type = NULL, .enum_type = &google_protobuf_FieldOptions_descriptor_enum_type, - .extension_range = &google_protobuf_FieldOptions_descriptor_extension_range, }; static struct upb_string google_protobuf_FieldOptions_ctype_fieldname = { .byte_len=5, .ptr="ctype" @@ -1106,7 +1064,7 @@ static struct upb_string google_protobuf_FieldOptions_ctype_field_typename = { .byte_len=5, .ptr="CType" }; -google_protobuf_FieldDescriptorProto google_protobuf_FieldOptions_ctype = { +google_protobuf_FieldDescriptorProto google_protobuf_FieldOptions_ctype_descriptor = { .name = &google_protobuf_FieldOptions_ctype_fieldname, .number = (uint32_t)1, .label = 1, @@ -1117,7 +1075,7 @@ static struct upb_string google_protobuf_FieldOptions_experimental_map_key_field .byte_len=20, .ptr="experimental_map_key" }; -google_protobuf_FieldDescriptorProto google_protobuf_FieldOptions_experimental_map_key = { +google_protobuf_FieldDescriptorProto google_protobuf_FieldOptions_experimental_map_key_descriptor = { .name = &google_protobuf_FieldOptions_experimental_map_key_fieldname, .number = (uint32_t)9, .label = 1, @@ -1132,7 +1090,7 @@ static struct upb_string google_protobuf_FieldOptions_uninterpreted_option_field .byte_len=19, .ptr="UninterpretedOption" }; -google_protobuf_FieldDescriptorProto google_protobuf_FieldOptions_uninterpreted_option = { +google_protobuf_FieldDescriptorProto google_protobuf_FieldOptions_uninterpreted_option_descriptor = { .name = &google_protobuf_FieldOptions_uninterpreted_option_fieldname, .number = (uint32_t)999, .label = 3, @@ -1151,7 +1109,7 @@ static struct upb_string google_protobuf_EnumOptions_descriptor_name = { .byte_len=11, .ptr="EnumOptions" }; -struct google_protobuf_FieldDescriptorProto google_protobuf_EnumOptions_uninterpreted_option_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_EnumOptions_uninterpreted_option_descriptor; static google_protobuf_FieldDescriptorProto *google_protobuf_EnumOptions_descriptor_field_array[] = { &google_protobuf_EnumOptions_uninterpreted_option_descriptor, @@ -1161,22 +1119,11 @@ static UPB_MSG_ARRAY(google_protobuf_FieldDescriptorProto) google_protobuf_EnumO .len=1, .elements=google_protobuf_EnumOptions_descriptor_field_array }; -struct google_protobuf_DescriptorProto_ExtensionRange google_protobuf_EnumOptions_descriptor_extension_range0_descriptor; - -static google_protobuf_DescriptorProto_ExtensionRange *google_protobuf_EnumOptions_descriptor_extension_range_array[] = { - &google_protobuf_EnumOptions_descriptor_extension_range0_descriptor, -}; - -static UPB_MSG_ARRAY(google_protobuf_DescriptorProto_ExtensionRange) google_protobuf_EnumOptions_descriptor_extension_range = { - .len=1, .elements=google_protobuf_EnumOptions_descriptor_extension_range_array -}; - google_protobuf_DescriptorProto google_protobuf_EnumOptions_descriptor = { .name = &google_protobuf_EnumOptions_descriptor_name, .field = &google_protobuf_EnumOptions_descriptor_field, .nested_type = NULL, .enum_type = NULL, - .extension_range = &google_protobuf_EnumOptions_descriptor_extension_range, }; static struct upb_string google_protobuf_EnumOptions_uninterpreted_option_fieldname = { .byte_len=20, .ptr="uninterpreted_option" @@ -1186,7 +1133,7 @@ static struct upb_string google_protobuf_EnumOptions_uninterpreted_option_field_ .byte_len=19, .ptr="UninterpretedOption" }; -google_protobuf_FieldDescriptorProto google_protobuf_EnumOptions_uninterpreted_option = { +google_protobuf_FieldDescriptorProto google_protobuf_EnumOptions_uninterpreted_option_descriptor = { .name = &google_protobuf_EnumOptions_uninterpreted_option_fieldname, .number = (uint32_t)999, .label = 3, @@ -1198,7 +1145,7 @@ static struct upb_string google_protobuf_EnumValueOptions_descriptor_name = { .byte_len=16, .ptr="EnumValueOptions" }; -struct google_protobuf_FieldDescriptorProto google_protobuf_EnumValueOptions_uninterpreted_option_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_EnumValueOptions_uninterpreted_option_descriptor; static google_protobuf_FieldDescriptorProto *google_protobuf_EnumValueOptions_descriptor_field_array[] = { &google_protobuf_EnumValueOptions_uninterpreted_option_descriptor, @@ -1208,22 +1155,11 @@ static UPB_MSG_ARRAY(google_protobuf_FieldDescriptorProto) google_protobuf_EnumV .len=1, .elements=google_protobuf_EnumValueOptions_descriptor_field_array }; -struct google_protobuf_DescriptorProto_ExtensionRange google_protobuf_EnumValueOptions_descriptor_extension_range0_descriptor; - -static google_protobuf_DescriptorProto_ExtensionRange *google_protobuf_EnumValueOptions_descriptor_extension_range_array[] = { - &google_protobuf_EnumValueOptions_descriptor_extension_range0_descriptor, -}; - -static UPB_MSG_ARRAY(google_protobuf_DescriptorProto_ExtensionRange) google_protobuf_EnumValueOptions_descriptor_extension_range = { - .len=1, .elements=google_protobuf_EnumValueOptions_descriptor_extension_range_array -}; - google_protobuf_DescriptorProto google_protobuf_EnumValueOptions_descriptor = { .name = &google_protobuf_EnumValueOptions_descriptor_name, .field = &google_protobuf_EnumValueOptions_descriptor_field, .nested_type = NULL, .enum_type = NULL, - .extension_range = &google_protobuf_EnumValueOptions_descriptor_extension_range, }; static struct upb_string google_protobuf_EnumValueOptions_uninterpreted_option_fieldname = { .byte_len=20, .ptr="uninterpreted_option" @@ -1233,7 +1169,7 @@ static struct upb_string google_protobuf_EnumValueOptions_uninterpreted_option_f .byte_len=19, .ptr="UninterpretedOption" }; -google_protobuf_FieldDescriptorProto google_protobuf_EnumValueOptions_uninterpreted_option = { +google_protobuf_FieldDescriptorProto google_protobuf_EnumValueOptions_uninterpreted_option_descriptor = { .name = &google_protobuf_EnumValueOptions_uninterpreted_option_fieldname, .number = (uint32_t)999, .label = 3, @@ -1245,7 +1181,7 @@ static struct upb_string google_protobuf_ServiceOptions_descriptor_name = { .byte_len=14, .ptr="ServiceOptions" }; -struct google_protobuf_FieldDescriptorProto google_protobuf_ServiceOptions_uninterpreted_option_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_ServiceOptions_uninterpreted_option_descriptor; static google_protobuf_FieldDescriptorProto *google_protobuf_ServiceOptions_descriptor_field_array[] = { &google_protobuf_ServiceOptions_uninterpreted_option_descriptor, @@ -1255,22 +1191,11 @@ static UPB_MSG_ARRAY(google_protobuf_FieldDescriptorProto) google_protobuf_Servi .len=1, .elements=google_protobuf_ServiceOptions_descriptor_field_array }; -struct google_protobuf_DescriptorProto_ExtensionRange google_protobuf_ServiceOptions_descriptor_extension_range0_descriptor; - -static google_protobuf_DescriptorProto_ExtensionRange *google_protobuf_ServiceOptions_descriptor_extension_range_array[] = { - &google_protobuf_ServiceOptions_descriptor_extension_range0_descriptor, -}; - -static UPB_MSG_ARRAY(google_protobuf_DescriptorProto_ExtensionRange) google_protobuf_ServiceOptions_descriptor_extension_range = { - .len=1, .elements=google_protobuf_ServiceOptions_descriptor_extension_range_array -}; - google_protobuf_DescriptorProto google_protobuf_ServiceOptions_descriptor = { .name = &google_protobuf_ServiceOptions_descriptor_name, .field = &google_protobuf_ServiceOptions_descriptor_field, .nested_type = NULL, .enum_type = NULL, - .extension_range = &google_protobuf_ServiceOptions_descriptor_extension_range, }; static struct upb_string google_protobuf_ServiceOptions_uninterpreted_option_fieldname = { .byte_len=20, .ptr="uninterpreted_option" @@ -1280,7 +1205,7 @@ static struct upb_string google_protobuf_ServiceOptions_uninterpreted_option_fie .byte_len=19, .ptr="UninterpretedOption" }; -google_protobuf_FieldDescriptorProto google_protobuf_ServiceOptions_uninterpreted_option = { +google_protobuf_FieldDescriptorProto google_protobuf_ServiceOptions_uninterpreted_option_descriptor = { .name = &google_protobuf_ServiceOptions_uninterpreted_option_fieldname, .number = (uint32_t)999, .label = 3, @@ -1292,7 +1217,7 @@ static struct upb_string google_protobuf_MethodOptions_descriptor_name = { .byte_len=13, .ptr="MethodOptions" }; -struct google_protobuf_FieldDescriptorProto google_protobuf_MethodOptions_uninterpreted_option_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_MethodOptions_uninterpreted_option_descriptor; static google_protobuf_FieldDescriptorProto *google_protobuf_MethodOptions_descriptor_field_array[] = { &google_protobuf_MethodOptions_uninterpreted_option_descriptor, @@ -1302,22 +1227,11 @@ static UPB_MSG_ARRAY(google_protobuf_FieldDescriptorProto) google_protobuf_Metho .len=1, .elements=google_protobuf_MethodOptions_descriptor_field_array }; -struct google_protobuf_DescriptorProto_ExtensionRange google_protobuf_MethodOptions_descriptor_extension_range0_descriptor; - -static google_protobuf_DescriptorProto_ExtensionRange *google_protobuf_MethodOptions_descriptor_extension_range_array[] = { - &google_protobuf_MethodOptions_descriptor_extension_range0_descriptor, -}; - -static UPB_MSG_ARRAY(google_protobuf_DescriptorProto_ExtensionRange) google_protobuf_MethodOptions_descriptor_extension_range = { - .len=1, .elements=google_protobuf_MethodOptions_descriptor_extension_range_array -}; - google_protobuf_DescriptorProto google_protobuf_MethodOptions_descriptor = { .name = &google_protobuf_MethodOptions_descriptor_name, .field = &google_protobuf_MethodOptions_descriptor_field, .nested_type = NULL, .enum_type = NULL, - .extension_range = &google_protobuf_MethodOptions_descriptor_extension_range, }; static struct upb_string google_protobuf_MethodOptions_uninterpreted_option_fieldname = { .byte_len=20, .ptr="uninterpreted_option" @@ -1327,7 +1241,7 @@ static struct upb_string google_protobuf_MethodOptions_uninterpreted_option_fiel .byte_len=19, .ptr="UninterpretedOption" }; -google_protobuf_FieldDescriptorProto google_protobuf_MethodOptions_uninterpreted_option = { +google_protobuf_FieldDescriptorProto google_protobuf_MethodOptions_uninterpreted_option_descriptor = { .name = &google_protobuf_MethodOptions_uninterpreted_option_fieldname, .number = (uint32_t)999, .label = 3, @@ -1339,12 +1253,12 @@ static struct upb_string google_protobuf_UninterpretedOption_descriptor_name = { .byte_len=19, .ptr="UninterpretedOption" }; -struct google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_name_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_identifier_value_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_positive_int_value_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_negative_int_value_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_double_value_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_string_value_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_name_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_identifier_value_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_positive_int_value_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_negative_int_value_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_double_value_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_string_value_descriptor; static google_protobuf_FieldDescriptorProto *google_protobuf_UninterpretedOption_descriptor_field_array[] = { &google_protobuf_UninterpretedOption_name_descriptor, @@ -1359,7 +1273,7 @@ static UPB_MSG_ARRAY(google_protobuf_FieldDescriptorProto) google_protobuf_Unint .len=6, .elements=google_protobuf_UninterpretedOption_descriptor_field_array }; -struct google_protobuf_DescriptorProto google_protobuf_UninterpretedOption_NamePart_descriptor; +extern struct google_protobuf_DescriptorProto google_protobuf_UninterpretedOption_NamePart_descriptor; static google_protobuf_DescriptorProto *google_protobuf_UninterpretedOption_descriptor_nested_type_array[] = { &google_protobuf_UninterpretedOption_NamePart_descriptor, @@ -1374,7 +1288,6 @@ google_protobuf_DescriptorProto google_protobuf_UninterpretedOption_descriptor = .field = &google_protobuf_UninterpretedOption_descriptor_field, .nested_type = &google_protobuf_UninterpretedOption_descriptor_nested_type, .enum_type = NULL, - .extension_range = NULL, }; static struct upb_string google_protobuf_UninterpretedOption_name_fieldname = { .byte_len=4, .ptr="name" @@ -1384,7 +1297,7 @@ static struct upb_string google_protobuf_UninterpretedOption_name_field_typename .byte_len=8, .ptr="NamePart" }; -google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_name = { +google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_name_descriptor = { .name = &google_protobuf_UninterpretedOption_name_fieldname, .number = (uint32_t)2, .label = 3, @@ -1395,7 +1308,7 @@ static struct upb_string google_protobuf_UninterpretedOption_identifier_value_fi .byte_len=16, .ptr="identifier_value" }; -google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_identifier_value = { +google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_identifier_value_descriptor = { .name = &google_protobuf_UninterpretedOption_identifier_value_fieldname, .number = (uint32_t)3, .label = 1, @@ -1406,7 +1319,7 @@ static struct upb_string google_protobuf_UninterpretedOption_positive_int_value_ .byte_len=18, .ptr="positive_int_value" }; -google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_positive_int_value = { +google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_positive_int_value_descriptor = { .name = &google_protobuf_UninterpretedOption_positive_int_value_fieldname, .number = (uint32_t)4, .label = 1, @@ -1417,7 +1330,7 @@ static struct upb_string google_protobuf_UninterpretedOption_negative_int_value_ .byte_len=18, .ptr="negative_int_value" }; -google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_negative_int_value = { +google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_negative_int_value_descriptor = { .name = &google_protobuf_UninterpretedOption_negative_int_value_fieldname, .number = (uint32_t)5, .label = 1, @@ -1428,7 +1341,7 @@ static struct upb_string google_protobuf_UninterpretedOption_double_value_fieldn .byte_len=12, .ptr="double_value" }; -google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_double_value = { +google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_double_value_descriptor = { .name = &google_protobuf_UninterpretedOption_double_value_fieldname, .number = (uint32_t)6, .label = 1, @@ -1439,7 +1352,7 @@ static struct upb_string google_protobuf_UninterpretedOption_string_value_fieldn .byte_len=12, .ptr="string_value" }; -google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_string_value = { +google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_string_value_descriptor = { .name = &google_protobuf_UninterpretedOption_string_value_fieldname, .number = (uint32_t)7, .label = 1, @@ -1451,8 +1364,8 @@ static struct upb_string google_protobuf_UninterpretedOption_NamePart_descriptor .byte_len=8, .ptr="NamePart" }; -struct google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_NamePart_name_part_descriptor; -struct google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_NamePart_is_extension_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_NamePart_name_part_descriptor; +extern struct google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_NamePart_is_extension_descriptor; static google_protobuf_FieldDescriptorProto *google_protobuf_UninterpretedOption_NamePart_descriptor_field_array[] = { &google_protobuf_UninterpretedOption_NamePart_name_part_descriptor, @@ -1468,13 +1381,12 @@ google_protobuf_DescriptorProto google_protobuf_UninterpretedOption_NamePart_des .field = &google_protobuf_UninterpretedOption_NamePart_descriptor_field, .nested_type = NULL, .enum_type = NULL, - .extension_range = NULL, }; static struct upb_string google_protobuf_UninterpretedOption_NamePart_name_part_fieldname = { .byte_len=9, .ptr="name_part" }; -google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_NamePart_name_part = { +google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_NamePart_name_part_descriptor = { .name = &google_protobuf_UninterpretedOption_NamePart_name_part_fieldname, .number = (uint32_t)1, .label = 2, @@ -1485,7 +1397,7 @@ static struct upb_string google_protobuf_UninterpretedOption_NamePart_is_extensi .byte_len=12, .ptr="is_extension" }; -google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_NamePart_is_extension = { +google_protobuf_FieldDescriptorProto google_protobuf_UninterpretedOption_NamePart_is_extension_descriptor = { .name = &google_protobuf_UninterpretedOption_NamePart_is_extension_fieldname, .number = (uint32_t)2, .label = 2, diff --git a/test_table.cc b/test_table.cc index 66b6b52..bcd0ca9 100644 --- a/test_table.cc +++ b/test_table.cc @@ -227,13 +227,32 @@ int32_t *get_contiguous_keys(int32_t num) int main() { vector keys; + keys.push_back("google.protobuf.FileDescriptorSet"); + keys.push_back("google.protobuf.FileDescriptorProto"); + keys.push_back("google.protobuf.DescriptorProto"); + keys.push_back("google.protobuf.DescriptorProto.ExtensionRange"); + keys.push_back("google.protobuf.FieldDescriptorProto"); + keys.push_back("google.protobuf.EnumDescriptorProto"); + keys.push_back("google.protobuf.EnumValueDescriptorProto"); + keys.push_back("google.protobuf.ServiceDescriptorProto"); + keys.push_back("google.protobuf.MethodDescriptorProto"); + keys.push_back("google.protobuf.FileOptions"); + keys.push_back("google.protobuf.MessageOptions"); + keys.push_back("google.protobuf.FieldOptions"); + keys.push_back("google.protobuf.EnumOptions"); + keys.push_back("google.protobuf.EnumValueOptions"); + keys.push_back("google.protobuf.ServiceOptions"); + keys.push_back("google.protobuf.MethodOptions"); + keys.push_back("google.protobuf.UninterpretedOption"); + keys.push_back("google.protobuf.UninterpretedOption.NamePart"); keys.push_back("A"); keys.push_back("B"); keys.push_back("C"); keys.push_back("D"); keys.push_back("E"); keys.push_back("F"); - test_strtable(keys, 5); + + test_strtable(keys, 18); return 0; int32_t *keys1 = get_contiguous_keys(8); printf("Contiguous 1-8 ====\n"); diff --git a/upb.h b/upb.h index ebf73c0..8c1af4f 100644 --- a/upb.h +++ b/upb.h @@ -54,6 +54,11 @@ INLINE void upb_strcpy(struct upb_string *dest, struct upb_string *src) { dest->byte_len = src->byte_len; } +INLINE void upb_print(struct upb_string *str) { + fwrite(str->ptr, str->byte_len, 1, stdout); + fputc('\n', stdout); +} + /* A list of types as they are encoded on-the-wire. */ enum upb_wire_type { UPB_WIRE_TYPE_VARINT = 0, diff --git a/upb_context.c b/upb_context.c index f960333..702358a 100644 --- a/upb_context.c +++ b/upb_context.c @@ -165,9 +165,12 @@ static bool insert_message(struct upb_strtable *t, return false; } upb_strtable_insert(t, &e.e); + printf("Inserted "); + upb_print(&e.e.key); /* Add nested messages and enums. */ - if(d->set_flags.has.nested_type) + //if(d->set_flags.has.nested_type) + if(d->nested_type) for(unsigned int i = 0; i < d->nested_type->len; i++) if(!insert_message(t, d->nested_type->elements[i], &fqname)) return false; @@ -220,12 +223,14 @@ bool upb_context_addfd(struct upb_context *c, google_protobuf_FieldDescriptorProto *fd = m->field_descriptors[i]; union upb_symbol_ref ref; if(fd->type == GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_TYPE_MESSAGE) - ref = resolve2(&c->symtab, &tmp, &e->e.key, fd->name, UPB_SYM_MESSAGE); + ref = resolve2(&c->symtab, &tmp, &e->e.key, fd->type_name, UPB_SYM_MESSAGE); else if(fd->type == GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_TYPE_ENUM) - ref = resolve2(&c->symtab, &tmp, &e->e.key, fd->name, UPB_SYM_ENUM); + ref = resolve2(&c->symtab, &tmp, &e->e.key, fd->type_name, UPB_SYM_ENUM); else continue; /* No resolving necessary. */ - if(!ref.msg) goto error; /* Ref. to undefined symbol. */ + upb_print(&e->e.key); + if(!ref.msg) { printf("FAILED!\n"); goto error; } /* Ref. to undefined symbol. */ + printf("Successful!\n"); upb_msg_ref(m, f, ref); } } diff --git a/upb_msg.c b/upb_msg.c index 89b396f..86c46de 100644 --- a/upb_msg.c +++ b/upb_msg.c @@ -40,6 +40,7 @@ bool upb_msg_init(struct upb_msg *m, struct google_protobuf_DescriptorProto *d) upb_strtable_init(&m->fields_by_name, d->field->len, sizeof(struct upb_fieldsbyname_entry)); + m->descriptor = d; m->num_fields = d->field->len; m->set_flags_bytes = div_round_up(m->num_fields, 8); /* These are incremented in the loop. */ diff --git a/upb_parse.c b/upb_parse.c index 8b86418..f44a847 100644 --- a/upb_parse.c +++ b/upb_parse.c @@ -100,8 +100,8 @@ static upb_status_t get_f_uint64_t(void *restrict *buf, void *end, *buf = uint64_end; #else uint32_t lo32, hi32; - get_f_uint32_t(buf, &lo32); - get_f_uint32_t(buf, &hi32); + get_f_uint32_t(buf, &lo32, end); + get_f_uint32_t(buf, &hi32, end); *val = lo32 | ((uint64_t)hi32 << 32); #endif return UPB_STATUS_OK; diff --git a/upb_table.c b/upb_table.c index 75fa266..1edf676 100644 --- a/upb_table.c +++ b/upb_table.c @@ -173,6 +173,7 @@ static void strinsert(struct upb_strtable *t, struct upb_strtable_entry *e) } memcpy(table_e, e, t->t.entry_size); table_e->next = UPB_END_OF_CHAIN; + assert(upb_strtable_lookup(t, &e->key) == table_e); } void upb_strtable_insert(struct upb_strtable *t, struct upb_strtable_entry *e) -- cgit v1.2.3