Auto-generate files after cl/698856552

pull/19352/head
Protobuf Team Bot 3 weeks ago
parent 3d065d1ced
commit d425214b42
  1. 16
      php/ext/google/protobuf/php-upb.c
  2. 4
      php/ext/google/protobuf/php-upb.h
  3. 16
      ruby/ext/google/protobuf_c/ruby-upb.c
  4. 4
      ruby/ext/google/protobuf_c/ruby-upb.h

@ -7619,19 +7619,23 @@ static upb_DecodeStatus upb_Decoder_Decode(upb_Decoder* const decoder,
return decoder->status;
}
uint16_t upb_DecodeOptions_GetEffectiveMaxDepth(uint32_t options) {
uint16_t max_depth = upb_DecodeOptions_GetMaxDepth(options);
return max_depth ? max_depth : kUpb_WireFormat_DefaultDepthLimit;
}
upb_DecodeStatus upb_Decode(const char* buf, size_t size, upb_Message* msg,
const upb_MiniTable* mt,
const upb_ExtensionRegistry* extreg, int options,
upb_Arena* arena) {
UPB_ASSERT(!upb_Message_IsFrozen(msg));
upb_Decoder decoder;
unsigned depth = (unsigned)options >> 16;
upb_EpsCopyInputStream_Init(&decoder.input, &buf, size,
options & kUpb_DecodeOption_AliasString);
decoder.extreg = extreg;
decoder.depth = depth ? depth : kUpb_WireFormat_DefaultDepthLimit;
decoder.depth = upb_DecodeOptions_GetEffectiveMaxDepth(options);
decoder.end_group = DECODE_NOGROUP;
decoder.options = (uint16_t)options;
decoder.missing_required = false;
@ -8341,19 +8345,23 @@ static upb_EncodeStatus upb_Encoder_Encode(upb_encstate* const encoder,
return encoder->status;
}
uint16_t upb_EncodeOptions_GetEffectiveMaxDepth(uint32_t options) {
uint16_t max_depth = upb_EncodeOptions_GetMaxDepth(options);
return max_depth ? max_depth : kUpb_WireFormat_DefaultDepthLimit;
}
static upb_EncodeStatus _upb_Encode(const upb_Message* msg,
const upb_MiniTable* l, int options,
upb_Arena* arena, char** buf, size_t* size,
bool prepend_len) {
upb_encstate e;
unsigned depth = (unsigned)options >> 16;
e.status = kUpb_EncodeStatus_Ok;
e.arena = arena;
e.buf = NULL;
e.limit = NULL;
e.ptr = NULL;
e.depth = depth ? depth : kUpb_WireFormat_DefaultDepthLimit;
e.depth = upb_EncodeOptions_GetEffectiveMaxDepth(options);
e.options = options;
_upb_mapsorter_init(&e.sorter);

@ -5414,6 +5414,8 @@ UPB_INLINE uint16_t upb_DecodeOptions_GetMaxDepth(uint32_t options) {
return options >> 16;
}
uint16_t upb_DecodeOptions_GetEffectiveMaxDepth(uint32_t options);
// Enforce an upper bound on recursion depth.
UPB_INLINE int upb_Decode_LimitDepth(uint32_t decode_options, uint32_t limit) {
uint32_t max_depth = upb_DecodeOptions_GetMaxDepth(decode_options);
@ -5514,6 +5516,8 @@ UPB_INLINE uint16_t upb_EncodeOptions_GetMaxDepth(uint32_t options) {
return options >> 16;
}
uint16_t upb_EncodeOptions_GetEffectiveMaxDepth(uint32_t options);
// Enforce an upper bound on recursion depth.
UPB_INLINE int upb_Encode_LimitDepth(uint32_t encode_options, uint32_t limit) {
uint32_t max_depth = upb_EncodeOptions_GetMaxDepth(encode_options);

@ -7619,19 +7619,23 @@ static upb_DecodeStatus upb_Decoder_Decode(upb_Decoder* const decoder,
return decoder->status;
}
uint16_t upb_DecodeOptions_GetEffectiveMaxDepth(uint32_t options) {
uint16_t max_depth = upb_DecodeOptions_GetMaxDepth(options);
return max_depth ? max_depth : kUpb_WireFormat_DefaultDepthLimit;
}
upb_DecodeStatus upb_Decode(const char* buf, size_t size, upb_Message* msg,
const upb_MiniTable* mt,
const upb_ExtensionRegistry* extreg, int options,
upb_Arena* arena) {
UPB_ASSERT(!upb_Message_IsFrozen(msg));
upb_Decoder decoder;
unsigned depth = (unsigned)options >> 16;
upb_EpsCopyInputStream_Init(&decoder.input, &buf, size,
options & kUpb_DecodeOption_AliasString);
decoder.extreg = extreg;
decoder.depth = depth ? depth : kUpb_WireFormat_DefaultDepthLimit;
decoder.depth = upb_DecodeOptions_GetEffectiveMaxDepth(options);
decoder.end_group = DECODE_NOGROUP;
decoder.options = (uint16_t)options;
decoder.missing_required = false;
@ -8341,19 +8345,23 @@ static upb_EncodeStatus upb_Encoder_Encode(upb_encstate* const encoder,
return encoder->status;
}
uint16_t upb_EncodeOptions_GetEffectiveMaxDepth(uint32_t options) {
uint16_t max_depth = upb_EncodeOptions_GetMaxDepth(options);
return max_depth ? max_depth : kUpb_WireFormat_DefaultDepthLimit;
}
static upb_EncodeStatus _upb_Encode(const upb_Message* msg,
const upb_MiniTable* l, int options,
upb_Arena* arena, char** buf, size_t* size,
bool prepend_len) {
upb_encstate e;
unsigned depth = (unsigned)options >> 16;
e.status = kUpb_EncodeStatus_Ok;
e.arena = arena;
e.buf = NULL;
e.limit = NULL;
e.ptr = NULL;
e.depth = depth ? depth : kUpb_WireFormat_DefaultDepthLimit;
e.depth = upb_EncodeOptions_GetEffectiveMaxDepth(options);
e.options = options;
_upb_mapsorter_init(&e.sorter);

@ -5416,6 +5416,8 @@ UPB_INLINE uint16_t upb_DecodeOptions_GetMaxDepth(uint32_t options) {
return options >> 16;
}
uint16_t upb_DecodeOptions_GetEffectiveMaxDepth(uint32_t options);
// Enforce an upper bound on recursion depth.
UPB_INLINE int upb_Decode_LimitDepth(uint32_t decode_options, uint32_t limit) {
uint32_t max_depth = upb_DecodeOptions_GetMaxDepth(decode_options);
@ -5516,6 +5518,8 @@ UPB_INLINE uint16_t upb_EncodeOptions_GetMaxDepth(uint32_t options) {
return options >> 16;
}
uint16_t upb_EncodeOptions_GetEffectiveMaxDepth(uint32_t options);
// Enforce an upper bound on recursion depth.
UPB_INLINE int upb_Encode_LimitDepth(uint32_t encode_options, uint32_t limit) {
uint32_t max_depth = upb_EncodeOptions_GetMaxDepth(encode_options);

Loading…
Cancel
Save