Skip to content

Commit

Permalink
upb: bugfix for importing a proto3 enum from within a proto2 file
Browse files Browse the repository at this point in the history
We missed a code path where we need to use upb_MiniTable_IsClosedEnum()

PiperOrigin-RevId: 551642215
  • Loading branch information
ericsalo authored and copybara-github committed Jul 27, 2023
1 parent 42cd349 commit b19edc5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion upb/mini_descriptor/link.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ bool upb_MiniTable_Link(upb_MiniTable* mt, const upb_MiniTable** sub_tables,

for (int i = 0; i < mt->field_count; i++) {
upb_MiniTableField* f = (upb_MiniTableField*)&mt->fields[i];
if (upb_MiniTableField_CType(f) == kUpb_CType_Enum) {
if (upb_MiniTableField_IsClosedEnum(f)) {
const upb_MiniTableEnum* sub = sub_enums[enum_count++];
if (enum_count > sub_enum_count) return false;
if (sub != NULL) {
Expand Down

0 comments on commit b19edc5

Please sign in to comment.