Skip to content

Commit

Permalink
Updated release branch to latest upb. (protocolbuffers#11258)
Browse files Browse the repository at this point in the history
* Updated release branch to latest upb.

* Updated amalgamated files.
  • Loading branch information
haberman authored and Dan Dees committed Mar 6, 2024
1 parent ee2d948 commit 4f280b3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
5 changes: 2 additions & 3 deletions php/ext/google/protobuf/php-upb.c
Expand Up @@ -6143,15 +6143,14 @@ upb_EnumReservedRange* _upb_EnumReservedRanges_New(
google_protobuf_EnumDescriptorProto_EnumReservedRange_start(protos[i]);
const int32_t end =
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
// none of the fields overlap with the extension ranges, but we are just
// sanity checking here.

// Note: Not a typo! Unlike extension ranges and message reserved ranges,
// 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",
(int)start, (int)end, upb_EnumDef_FullName(e));
}
Expand Down Expand Up @@ -8184,7 +8183,7 @@ static void create_fielddef(
CHK_OOM(
upb_strtable_insert(&oneof->ntof, name.data, name.size, v, ctx->arena));
} else {
if (f->proto3_optional_) {
if (f->proto3_optional_ && !is_extension) {
symtab_errf(ctx, "field with proto3_optional was not in a oneof (%s)",
f->full_name);
}
Expand Down
4 changes: 2 additions & 2 deletions protobuf_deps.bzl
Expand Up @@ -117,6 +117,6 @@ def protobuf_deps():
_github_archive(
name = "upb",
repo = "https://github.com/protocolbuffers/upb",
commit = "969f6fdb88e94ced87953e53716893c68ec7b1ce",
sha256 = "6754b7f95c92f69a832a82931aea40d066cc689dbc1eb3348b84c1ed95285296",
commit = "20b542a767139732548f7b8cf28c4c928cdcb07b",
sha256 = "c77158955326f9e9a0cf8481c118b8ad5c34df99e5db3af27f3d1662d8bedef7",
)
5 changes: 2 additions & 3 deletions ruby/ext/google/protobuf_c/ruby-upb.c
Expand Up @@ -5814,15 +5814,14 @@ upb_EnumReservedRange* _upb_EnumReservedRanges_New(
google_protobuf_EnumDescriptorProto_EnumReservedRange_start(protos[i]);
const int32_t end =
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
// none of the fields overlap with the extension ranges, but we are just
// sanity checking here.

// Note: Not a typo! Unlike extension ranges and message reserved ranges,
// 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",
(int)start, (int)end, upb_EnumDef_FullName(e));
}
Expand Down Expand Up @@ -7855,7 +7854,7 @@ static void create_fielddef(
CHK_OOM(
upb_strtable_insert(&oneof->ntof, name.data, name.size, v, ctx->arena));
} else {
if (f->proto3_optional_) {
if (f->proto3_optional_ && !is_extension) {
symtab_errf(ctx, "field with proto3_optional was not in a oneof (%s)",
f->full_name);
}
Expand Down

0 comments on commit 4f280b3

Please sign in to comment.