Internal change.

PiperOrigin-RevId: 632214712
pull/16809/head
Éamonn McManus 2024-05-09 11:25:41 -07:00 committed by Copybara-Service
parent 495ba7bcdb
commit 83e07b9e68
1 changed files with 4 additions and 0 deletions

View File

@ -8,6 +8,7 @@
#ifndef UPB_MINI_TABLE_INTERNAL_EXTENSION_H_
#define UPB_MINI_TABLE_INTERNAL_EXTENSION_H_
#include <stddef.h>
#include <stdint.h>
#include "upb/base/descriptor_constants.h"
@ -41,6 +42,9 @@ upb_MiniTableExtension_Number(const struct upb_MiniTableExtension* e) {
UPB_API_INLINE const struct upb_MiniTable* upb_MiniTableExtension_GetSubMessage(
const struct upb_MiniTableExtension* e) {
if (upb_MiniTableExtension_CType(e) != kUpb_CType_Message) {
return NULL;
}
return upb_MiniTableSub_Message(e->UPB_PRIVATE(sub));
}