Updated release branch to latest upb. (#11258)

* Updated release branch to latest upb.

* Updated amalgamated files.
pull/11286/head
Joshua Haberman 2 years ago committed by GitHub
parent 7c123c40e2
commit 7b0ca6995d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      php/ext/google/protobuf/php-upb.c
  2. 4
      protobuf_deps.bzl
  3. 5
      ruby/ext/google/protobuf_c/ruby-upb.c

@ -6143,7 +6143,6 @@ upb_EnumReservedRange* _upb_EnumReservedRanges_New(
google_protobuf_EnumDescriptorProto_EnumReservedRange_start(protos[i]); google_protobuf_EnumDescriptorProto_EnumReservedRange_start(protos[i]);
const int32_t end = const int32_t end =
google_protobuf_EnumDescriptorProto_EnumReservedRange_end(protos[i]); google_protobuf_EnumDescriptorProto_EnumReservedRange_end(protos[i]);
const int32_t max = kUpb_MaxFieldNumber + 1;
// A full validation would also check that each range is disjoint, and that // A full validation would also check that each range is disjoint, and that
// none of the fields overlap with the extension ranges, but we are just // none of the fields overlap with the extension ranges, but we are just
@ -6151,7 +6150,7 @@ upb_EnumReservedRange* _upb_EnumReservedRanges_New(
// Note: Not a typo! Unlike extension ranges and message reserved ranges, // Note: Not a typo! Unlike extension ranges and message reserved ranges,
// the end value of an enum reserved range is *inclusive*! // the end value of an enum reserved range is *inclusive*!
if (start < 1 || end < start || end > max) { if (end < start) {
symtab_errf(ctx, "Reserved range (%d, %d) is invalid, enum=%s\n", symtab_errf(ctx, "Reserved range (%d, %d) is invalid, enum=%s\n",
(int)start, (int)end, upb_EnumDef_FullName(e)); (int)start, (int)end, upb_EnumDef_FullName(e));
} }
@ -8184,7 +8183,7 @@ static void create_fielddef(
CHK_OOM( CHK_OOM(
upb_strtable_insert(&oneof->ntof, name.data, name.size, v, ctx->arena)); upb_strtable_insert(&oneof->ntof, name.data, name.size, v, ctx->arena));
} else { } else {
if (f->proto3_optional_) { if (f->proto3_optional_ && !is_extension) {
symtab_errf(ctx, "field with proto3_optional was not in a oneof (%s)", symtab_errf(ctx, "field with proto3_optional was not in a oneof (%s)",
f->full_name); f->full_name);
} }

@ -117,6 +117,6 @@ def protobuf_deps():
_github_archive( _github_archive(
name = "upb", name = "upb",
repo = "https://github.com/protocolbuffers/upb", repo = "https://github.com/protocolbuffers/upb",
commit = "969f6fdb88e94ced87953e53716893c68ec7b1ce", commit = "20b542a767139732548f7b8cf28c4c928cdcb07b",
sha256 = "6754b7f95c92f69a832a82931aea40d066cc689dbc1eb3348b84c1ed95285296", sha256 = "c77158955326f9e9a0cf8481c118b8ad5c34df99e5db3af27f3d1662d8bedef7",
) )

@ -5814,7 +5814,6 @@ upb_EnumReservedRange* _upb_EnumReservedRanges_New(
google_protobuf_EnumDescriptorProto_EnumReservedRange_start(protos[i]); google_protobuf_EnumDescriptorProto_EnumReservedRange_start(protos[i]);
const int32_t end = const int32_t end =
google_protobuf_EnumDescriptorProto_EnumReservedRange_end(protos[i]); google_protobuf_EnumDescriptorProto_EnumReservedRange_end(protos[i]);
const int32_t max = kUpb_MaxFieldNumber + 1;
// A full validation would also check that each range is disjoint, and that // A full validation would also check that each range is disjoint, and that
// none of the fields overlap with the extension ranges, but we are just // none of the fields overlap with the extension ranges, but we are just
@ -5822,7 +5821,7 @@ upb_EnumReservedRange* _upb_EnumReservedRanges_New(
// Note: Not a typo! Unlike extension ranges and message reserved ranges, // Note: Not a typo! Unlike extension ranges and message reserved ranges,
// the end value of an enum reserved range is *inclusive*! // the end value of an enum reserved range is *inclusive*!
if (start < 1 || end < start || end > max) { if (end < start) {
symtab_errf(ctx, "Reserved range (%d, %d) is invalid, enum=%s\n", symtab_errf(ctx, "Reserved range (%d, %d) is invalid, enum=%s\n",
(int)start, (int)end, upb_EnumDef_FullName(e)); (int)start, (int)end, upb_EnumDef_FullName(e));
} }
@ -7855,7 +7854,7 @@ static void create_fielddef(
CHK_OOM( CHK_OOM(
upb_strtable_insert(&oneof->ntof, name.data, name.size, v, ctx->arena)); upb_strtable_insert(&oneof->ntof, name.data, name.size, v, ctx->arena));
} else { } else {
if (f->proto3_optional_) { if (f->proto3_optional_ && !is_extension) {
symtab_errf(ctx, "field with proto3_optional was not in a oneof (%s)", symtab_errf(ctx, "field with proto3_optional was not in a oneof (%s)",
f->full_name); f->full_name);
} }

Loading…
Cancel
Save