From 2e8a122fc0523f759e8ab53e79c651a51c44e4ad Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Tue, 1 Jun 2021 08:23:19 -0700 Subject: [PATCH] Changed dense_below calculation to use UINT8_MAX as the constant. --- upb/def.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/upb/def.c b/upb/def.c index 97b34aa6f8..04b41cee7c 100644 --- a/upb/def.c +++ b/upb/def.c @@ -1027,8 +1027,8 @@ static void assign_layout_indices(const upb_msgdef *m, upb_msglayout *l, upb_fielddef *f = (upb_fielddef*)upb_msgdef_itof(m, fields[i].number); UPB_ASSERT(f); f->layout_index = i; - if (i <= 254 && upb_fielddef_number(f) == i + 1) { - dense_below = upb_fielddef_number(f); + if (i < UINT8_MAX && upb_fielddef_number(f) == i + 1) { + dense_below = i + 1; } } l->dense_below = dense_below;