diff --git a/upb/decode.c b/upb/decode.c index aa5d7215be..cd13125290 100644 --- a/upb/decode.c +++ b/upb/decode.c @@ -224,8 +224,8 @@ static upb_array *upb_getorcreatearr(upb_decframe *frame, static void upb_sethasbit(upb_decframe *frame, const upb_msglayout_field *field) { - UPB_ASSERT(field->presence > 0); int32_t hasbit = field->presence; + UPB_ASSERT(field->presence > 0); frame->msg[hasbit / 8] |= (1 << (hasbit % 8)); } diff --git a/upb/encode.c b/upb/encode.c index 45f8159eda..a9f2c0d24a 100644 --- a/upb/encode.c +++ b/upb/encode.c @@ -134,8 +134,8 @@ static uint32_t upb_readcase(const char *msg, const upb_msglayout_field *f) { } static bool upb_readhasbit(const char *msg, const upb_msglayout_field *f) { - UPB_ASSERT(f->presence > 0); uint32_t hasbit = f->presence; + UPB_ASSERT(f->presence > 0); return msg[hasbit / 8] & (1 << (hasbit % 8)); }