upb: bugfix for importing a proto3 enum from within a proto2 file

We missed a code path where we need to use upb_MiniTable_IsClosedEnum()

PiperOrigin-RevId: 551642215
pull/13675/head^2
Eric Salo 1 year ago committed by Copybara-Service
parent 42cd34948c
commit b19edc5ce0
  1. 2
      upb/mini_descriptor/link.c

@ -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) {

Loading…
Cancel
Save