Skip to content
This repository was archived by the owner on Dec 9, 2025. It is now read-only.

Commit b19edc5

Browse files
ericsalocopybara-github
authored andcommitted
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
1 parent 42cd349 commit b19edc5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

upb/mini_descriptor/link.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ bool upb_MiniTable_Link(upb_MiniTable* mt, const upb_MiniTable** sub_tables,
129129

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

0 commit comments

Comments
 (0)