Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated release branch to latest upb. #11258

Merged
merged 2 commits into from Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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