No longer allow minidescriptors to accept message fields tagged as proto3 scalar (implicit presence)

PiperOrigin-RevId: 606340283
pull/15806/head
Protobuf Team Bot 11 months ago committed by Copybara-Service
parent 9473beb76c
commit 52f9ea88d8
  1. 6
      upb/mini_descriptor/decode.c

@ -245,6 +245,12 @@ static void upb_MtDecoder_ModifyField(upb_MtDecoder* d,
upb_MiniTableField_Number(field));
}
if (singular && upb_MiniTableField_IsSubMessage(field)) {
upb_MdDecoder_ErrorJmp(&d->base,
"Field %" PRIu32 " cannot be a singular submessage",
upb_MiniTableField_Number(field));
}
if (singular) field->UPB_PRIVATE(offset) = kNoPresence;
if (required) {
field->UPB_PRIVATE(offset) = kRequiredPresence;

Loading…
Cancel
Save