Auto-generate files after cl/590961088

pull/15065/head
Protobuf Team Bot 12 months ago
parent 9c7d2b9d83
commit e02fbdadbf
  1. 21
      php/ext/google/protobuf/php-upb.h
  2. 21
      ruby/ext/google/protobuf_c/ruby-upb.h

@ -13497,26 +13497,7 @@ extern const uint8_t upb_utf8_offsets[];
UPB_INLINE UPB_INLINE
bool _upb_Decoder_VerifyUtf8Inline(const char* ptr, int len) { bool _upb_Decoder_VerifyUtf8Inline(const char* ptr, int len) {
const char* end = ptr + len; return utf8_range_IsValid(ptr, len);
// Check 8 bytes at a time for any non-ASCII char.
while (end - ptr >= 8) {
uint64_t data;
memcpy(&data, ptr, 8);
if (data & 0x8080808080808080) goto non_ascii;
ptr += 8;
}
// Check one byte at a time for non-ASCII.
while (ptr < end) {
if (*ptr & 0x80) goto non_ascii;
ptr++;
}
return true;
non_ascii:
return utf8_range2((const unsigned char*)ptr, end - ptr) == 0;
} }
const char* _upb_Decoder_CheckRequired(upb_Decoder* d, const char* ptr, const char* _upb_Decoder_CheckRequired(upb_Decoder* d, const char* ptr,

@ -13316,26 +13316,7 @@ extern const uint8_t upb_utf8_offsets[];
UPB_INLINE UPB_INLINE
bool _upb_Decoder_VerifyUtf8Inline(const char* ptr, int len) { bool _upb_Decoder_VerifyUtf8Inline(const char* ptr, int len) {
const char* end = ptr + len; return utf8_range_IsValid(ptr, len);
// Check 8 bytes at a time for any non-ASCII char.
while (end - ptr >= 8) {
uint64_t data;
memcpy(&data, ptr, 8);
if (data & 0x8080808080808080) goto non_ascii;
ptr += 8;
}
// Check one byte at a time for non-ASCII.
while (ptr < end) {
if (*ptr & 0x80) goto non_ascii;
ptr++;
}
return true;
non_ascii:
return utf8_range2((const unsigned char*)ptr, end - ptr) == 0;
} }
const char* _upb_Decoder_CheckRequired(upb_Decoder* d, const char* ptr, const char* _upb_Decoder_CheckRequired(upb_Decoder* d, const char* ptr,

Loading…
Cancel
Save