protobuf/src/google/protobuf/parse_context.cc
Go to the documentation of this file.
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc. All rights reserved.
3 // https://developers.google.com/protocol-buffers/
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 // * Redistributions in binary form must reproduce the above
12 // copyright notice, this list of conditions and the following disclaimer
13 // in the documentation and/or other materials provided with the
14 // distribution.
15 // * Neither the name of Google Inc. nor the names of its
16 // contributors may be used to endorse or promote products derived from
17 // this software without specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 #include <google/protobuf/parse_context.h>
32 
33 #include <google/protobuf/stubs/stringprintf.h>
34 #include <google/protobuf/io/coded_stream.h>
35 #include <google/protobuf/io/zero_copy_stream.h>
36 #include <google/protobuf/arenastring.h>
37 #include <google/protobuf/message_lite.h>
38 #include <google/protobuf/repeated_field.h>
39 #include <google/protobuf/wire_format_lite.h>
40 #include <google/protobuf/stubs/strutil.h>
41 
42 #include <google/protobuf/port_def.inc>
43 
44 namespace google {
45 namespace protobuf {
46 namespace internal {
47 
48 namespace {
49 
50 // Only call if at start of tag.
51 bool ParseEndsInSlopRegion(const char* begin, int overrun, int depth) {
52  constexpr int kSlopBytes = EpsCopyInputStream::kSlopBytes;
53  GOOGLE_DCHECK(overrun >= 0);
54  GOOGLE_DCHECK(overrun <= kSlopBytes);
55  auto ptr = begin + overrun;
56  auto end = begin + kSlopBytes;
57  while (ptr < end) {
58  uint32_t tag;
59  ptr = ReadTag(ptr, &tag);
60  if (ptr == nullptr || ptr > end) return false;
61  // ending on 0 tag is allowed and is the major reason for the necessity of
62  // this function.
63  if (tag == 0) return true;
64  switch (tag & 7) {
65  case 0: { // Varint
66  uint64_t val;
67  ptr = VarintParse(ptr, &val);
68  if (ptr == nullptr) return false;
69  break;
70  }
71  case 1: { // fixed64
72  ptr += 8;
73  break;
74  }
75  case 2: { // len delim
77  if (ptr == nullptr || size > end - ptr) return false;
78  ptr += size;
79  break;
80  }
81  case 3: { // start group
82  depth++;
83  break;
84  }
85  case 4: { // end group
86  if (--depth < 0) return true; // We exit early
87  break;
88  }
89  case 5: { // fixed32
90  ptr += 4;
91  break;
92  }
93  default:
94  return false; // Unknown wireformat
95  }
96  }
97  return false;
98 }
99 
100 } // namespace
101 
102 const char* EpsCopyInputStream::NextBuffer(int overrun, int depth) {
103  if (next_chunk_ == nullptr) return nullptr; // We've reached end of stream.
104  if (next_chunk_ != buffer_) {
106  // The chunk is large enough to be used directly
108  auto res = next_chunk_;
111  return res;
112  }
113  // Move the slop bytes of previous buffer to start of the patch buffer.
114  // Note we must use memmove because the previous buffer could be part of
115  // buffer_.
116  std::memmove(buffer_, buffer_end_, kSlopBytes);
117  if (overall_limit_ > 0 &&
118  (depth < 0 || !ParseEndsInSlopRegion(buffer_, overrun, depth))) {
119  const void* data;
120  // ZeroCopyInputStream indicates Next may return 0 size buffers. Hence
121  // we loop.
122  while (StreamNext(&data)) {
123  if (size_ > kSlopBytes) {
124  // We got a large chunk
126  next_chunk_ = static_cast<const char*>(data);
129  return buffer_;
130  } else if (size_ > 0) {
135  return buffer_;
136  }
137  GOOGLE_DCHECK(size_ == 0) << size_;
138  }
139  overall_limit_ = 0; // Next failed, no more needs for next
140  }
141  // End of stream or array
142  if (aliasing_ == kNoDelta) {
143  // If there is no more block and aliasing is true, the previous block
144  // is still valid and we can alias. We have users relying on string_view's
145  // obtained from protos to outlive the proto, when the parse was from an
146  // array. This guarantees string_view's are always aliased if parsed from
147  // an array.
148  aliasing_ = reinterpret_cast<std::uintptr_t>(buffer_end_) -
149  reinterpret_cast<std::uintptr_t>(buffer_);
150  }
151  next_chunk_ = nullptr;
153  size_ = 0;
154  return buffer_;
155 }
156 
159  auto p = NextBuffer(0 /* immaterial */, -1);
160  if (p == nullptr) {
162  // Distinguish ending on a pushed limit or ending on end-of-stream.
163  SetEndOfStream();
164  return nullptr;
165  }
166  limit_ -= buffer_end_ - p; // Adjust limit_ relative to new anchor
168  return p;
169 }
170 
171 std::pair<const char*, bool> EpsCopyInputStream::DoneFallback(int overrun,
172  int depth) {
173  // Did we exceeded the limit (parse error).
174  if (PROTOBUF_PREDICT_FALSE(overrun > limit_)) return {nullptr, true};
175  GOOGLE_DCHECK(overrun != limit_); // Guaranteed by caller.
176  GOOGLE_DCHECK(overrun < limit_); // Follows from above
177  // TODO(gerbens) Instead of this dcheck we could just assign, and remove
178  // updating the limit_end from PopLimit, ie.
179  // limit_end_ = buffer_end_ + (std::min)(0, limit_);
180  // if (ptr < limit_end_) return {ptr, false};
182  // At this point we know the following assertion holds.
183  GOOGLE_DCHECK(limit_ > 0);
184  GOOGLE_DCHECK(limit_end_ == buffer_end_); // because limit_ > 0
185  const char* p;
186  do {
187  // We are past the end of buffer_end_, in the slop region.
188  GOOGLE_DCHECK(overrun >= 0);
189  p = NextBuffer(overrun, depth);
190  if (p == nullptr) {
191  // We are at the end of the stream
192  if (PROTOBUF_PREDICT_FALSE(overrun != 0)) return {nullptr, true};
193  GOOGLE_DCHECK(limit_ > 0);
195  // Distinguish ending on a pushed limit or ending on end-of-stream.
196  SetEndOfStream();
197  return {buffer_end_, true};
198  }
199  limit_ -= buffer_end_ - p; // Adjust limit_ relative to new anchor
200  p += overrun;
201  overrun = p - buffer_end_;
202  } while (overrun >= 0);
204  return {p, false};
205 }
206 
207 const char* EpsCopyInputStream::SkipFallback(const char* ptr, int size) {
208  return AppendSize(ptr, size, [](const char* /*p*/, int /*s*/) {});
209 }
210 
211 const char* EpsCopyInputStream::ReadStringFallback(const char* ptr, int size,
212  std::string* str) {
213  str->clear();
214  if (PROTOBUF_PREDICT_TRUE(size <= buffer_end_ - ptr + limit_)) {
215  // Reserve the string up to a static safe size. If strings are bigger than
216  // this we proceed by growing the string as needed. This protects against
217  // malicious payloads making protobuf hold on to a lot of memory.
218  str->reserve(str->size() + std::min<int>(size, kSafeStringSize));
219  }
220  return AppendSize(ptr, size,
221  [str](const char* p, int s) { str->append(p, s); });
222 }
223 
224 const char* EpsCopyInputStream::AppendStringFallback(const char* ptr, int size,
225  std::string* str) {
226  if (PROTOBUF_PREDICT_TRUE(size <= buffer_end_ - ptr + limit_)) {
227  // Reserve the string up to a static safe size. If strings are bigger than
228  // this we proceed by growing the string as needed. This protects against
229  // malicious payloads making protobuf hold on to a lot of memory.
230  str->reserve(str->size() + std::min<int>(size, kSafeStringSize));
231  }
232  return AppendSize(ptr, size,
233  [str](const char* p, int s) { str->append(p, s); });
234 }
235 
236 
237 template <int>
238 void byteswap(void* p);
239 template <>
240 void byteswap<1>(void* /*p*/) {}
241 template <>
242 void byteswap<4>(void* p) {
243  *static_cast<uint32_t*>(p) = bswap_32(*static_cast<uint32_t*>(p));
244 }
245 template <>
246 void byteswap<8>(void* p) {
247  *static_cast<uint64_t*>(p) = bswap_64(*static_cast<uint64_t*>(p));
248 }
249 
251  zcis_ = zcis;
252  const void* data;
253  int size;
254  limit_ = INT_MAX;
255  if (zcis->Next(&data, &size)) {
256  overall_limit_ -= size;
257  if (size > kSlopBytes) {
258  auto ptr = static_cast<const char*>(data);
259  limit_ -= size - kSlopBytes;
263  return ptr;
264  } else {
267  auto ptr = buffer_ + 2 * kSlopBytes - size;
269  return ptr;
270  }
271  }
272  overall_limit_ = 0;
273  next_chunk_ = nullptr;
274  size_ = 0;
276  return buffer_;
277 }
278 
280  int* old_limit) {
281  int size = ReadSize(&ptr);
282  if (PROTOBUF_PREDICT_FALSE(!ptr)) {
283  *old_limit = 0; // Make sure this isn't uninitialized even on error return
284  return nullptr;
285  }
286  *old_limit = PushLimit(ptr, size);
287  if (--depth_ < 0) return nullptr;
288  return ptr;
289 }
290 
291 const char* ParseContext::ParseMessage(MessageLite* msg, const char* ptr) {
292  int old;
294  ptr = ptr ? msg->_InternalParse(ptr, this) : nullptr;
295  depth_++;
296  if (!PopLimit(old)) return nullptr;
297  return ptr;
298 }
299 
300 inline void WriteVarint(uint64_t val, std::string* s) {
301  while (val >= 128) {
302  uint8_t c = val | 0x80;
303  s->push_back(c);
304  val >>= 7;
305  }
306  s->push_back(val);
307 }
308 
310  WriteVarint(num << 3, s);
311  WriteVarint(val, s);
312 }
313 
314 void WriteLengthDelimited(uint32_t num, StringPiece val, std::string* s) {
315  WriteVarint((num << 3) + 2, s);
316  WriteVarint(val.size(), s);
317  s->append(val.data(), val.size());
318 }
319 
320 std::pair<const char*, uint32_t> VarintParseSlow32(const char* p,
321  uint32_t res) {
322  for (std::uint32_t i = 2; i < 5; i++) {
323  uint32_t byte = static_cast<uint8_t>(p[i]);
324  res += (byte - 1) << (7 * i);
325  if (PROTOBUF_PREDICT_TRUE(byte < 128)) {
326  return {p + i + 1, res};
327  }
328  }
329  // Accept >5 bytes
330  for (std::uint32_t i = 5; i < 10; i++) {
331  uint32_t byte = static_cast<uint8_t>(p[i]);
332  if (PROTOBUF_PREDICT_TRUE(byte < 128)) {
333  return {p + i + 1, res};
334  }
335  }
336  return {nullptr, 0};
337 }
338 
339 std::pair<const char*, uint64_t> VarintParseSlow64(const char* p,
340  uint32_t res32) {
341  uint64_t res = res32;
342  for (std::uint32_t i = 2; i < 10; i++) {
343  uint64_t byte = static_cast<uint8_t>(p[i]);
344  res += (byte - 1) << (7 * i);
345  if (PROTOBUF_PREDICT_TRUE(byte < 128)) {
346  return {p + i + 1, res};
347  }
348  }
349  return {nullptr, 0};
350 }
351 
352 std::pair<const char*, uint32_t> ReadTagFallback(const char* p, uint32_t res) {
353  for (std::uint32_t i = 2; i < 5; i++) {
354  uint32_t byte = static_cast<uint8_t>(p[i]);
355  res += (byte - 1) << (7 * i);
356  if (PROTOBUF_PREDICT_TRUE(byte < 128)) {
357  return {p + i + 1, res};
358  }
359  }
360  return {nullptr, 0};
361 }
362 
363 std::pair<const char*, int32_t> ReadSizeFallback(const char* p, uint32_t res) {
364  for (std::uint32_t i = 1; i < 4; i++) {
365  uint32_t byte = static_cast<uint8_t>(p[i]);
366  res += (byte - 1) << (7 * i);
367  if (PROTOBUF_PREDICT_TRUE(byte < 128)) {
368  return {p + i + 1, res};
369  }
370  }
371  std::uint32_t byte = static_cast<uint8_t>(p[4]);
372  if (PROTOBUF_PREDICT_FALSE(byte >= 8)) return {nullptr, 0}; // size >= 2gb
373  res += (byte - 1) << 28;
374  // Protect against sign integer overflow in PushLimit. Limits are relative
375  // to buffer ends and ptr could potential be kSlopBytes beyond a buffer end.
376  // To protect against overflow we reject limits absurdly close to INT_MAX.
377  if (PROTOBUF_PREDICT_FALSE(res > INT_MAX - ParseContext::kSlopBytes)) {
378  return {nullptr, 0};
379  }
380  return {p + 5, res};
381 }
382 
383 const char* StringParser(const char* begin, const char* end, void* object,
384  ParseContext*) {
385  auto str = static_cast<std::string*>(object);
386  str->append(begin, end - begin);
387  return end;
388 }
389 
390 // Defined in wire_format_lite.cc
391 void PrintUTF8ErrorLog(const char* field_name, const char* operation_str,
392  bool emit_stacktrace);
393 
394 bool VerifyUTF8(StringPiece str, const char* field_name) {
396  PrintUTF8ErrorLog(field_name, "parsing", false);
397  return false;
398  }
399  return true;
400 }
401 
402 const char* InlineGreedyStringParser(std::string* s, const char* ptr,
403  ParseContext* ctx) {
404  int size = ReadSize(&ptr);
405  if (!ptr) return nullptr;
406  return ctx->ReadString(ptr, size, s);
407 }
408 
409 
410 template <typename T, bool sign>
411 const char* VarintParser(void* object, const char* ptr, ParseContext* ctx) {
412  return ctx->ReadPackedVarint(ptr, [object](uint64_t varint) {
413  T val;
414  if (sign) {
415  if (sizeof(T) == 8) {
416  val = WireFormatLite::ZigZagDecode64(varint);
417  } else {
418  val = WireFormatLite::ZigZagDecode32(varint);
419  }
420  } else {
421  val = varint;
422  }
423  static_cast<RepeatedField<T>*>(object)->Add(val);
424  });
425 }
426 
427 const char* PackedInt32Parser(void* object, const char* ptr,
428  ParseContext* ctx) {
429  return VarintParser<int32_t, false>(object, ptr, ctx);
430 }
431 const char* PackedUInt32Parser(void* object, const char* ptr,
432  ParseContext* ctx) {
433  return VarintParser<uint32_t, false>(object, ptr, ctx);
434 }
435 const char* PackedInt64Parser(void* object, const char* ptr,
436  ParseContext* ctx) {
437  return VarintParser<int64_t, false>(object, ptr, ctx);
438 }
439 const char* PackedUInt64Parser(void* object, const char* ptr,
440  ParseContext* ctx) {
441  return VarintParser<uint64_t, false>(object, ptr, ctx);
442 }
443 const char* PackedSInt32Parser(void* object, const char* ptr,
444  ParseContext* ctx) {
445  return VarintParser<int32_t, true>(object, ptr, ctx);
446 }
447 const char* PackedSInt64Parser(void* object, const char* ptr,
448  ParseContext* ctx) {
449  return VarintParser<int64_t, true>(object, ptr, ctx);
450 }
451 
452 const char* PackedEnumParser(void* object, const char* ptr, ParseContext* ctx) {
453  return VarintParser<int, false>(object, ptr, ctx);
454 }
455 
456 const char* PackedBoolParser(void* object, const char* ptr, ParseContext* ctx) {
457  return VarintParser<bool, false>(object, ptr, ctx);
458 }
459 
460 template <typename T>
461 const char* FixedParser(void* object, const char* ptr, ParseContext* ctx) {
462  int size = ReadSize(&ptr);
463  return ctx->ReadPackedFixed(ptr, size,
464  static_cast<RepeatedField<T>*>(object));
465 }
466 
467 const char* PackedFixed32Parser(void* object, const char* ptr,
468  ParseContext* ctx) {
469  return FixedParser<uint32_t>(object, ptr, ctx);
470 }
471 const char* PackedSFixed32Parser(void* object, const char* ptr,
472  ParseContext* ctx) {
473  return FixedParser<int32_t>(object, ptr, ctx);
474 }
475 const char* PackedFixed64Parser(void* object, const char* ptr,
476  ParseContext* ctx) {
477  return FixedParser<uint64_t>(object, ptr, ctx);
478 }
479 const char* PackedSFixed64Parser(void* object, const char* ptr,
480  ParseContext* ctx) {
481  return FixedParser<int64_t>(object, ptr, ctx);
482 }
483 const char* PackedFloatParser(void* object, const char* ptr,
484  ParseContext* ctx) {
485  return FixedParser<float>(object, ptr, ctx);
486 }
487 const char* PackedDoubleParser(void* object, const char* ptr,
488  ParseContext* ctx) {
489  return FixedParser<double>(object, ptr, ctx);
490 }
491 
492 class UnknownFieldLiteParserHelper {
493  public:
495  : unknown_(unknown) {}
496 
498  if (unknown_ == nullptr) return;
499  WriteVarint(num * 8, unknown_);
501  }
503  if (unknown_ == nullptr) return;
504  WriteVarint(num * 8 + 1, unknown_);
505  char buffer[8];
507  value, reinterpret_cast<uint8_t*>(buffer));
508  unknown_->append(buffer, 8);
509  }
510  const char* ParseLengthDelimited(uint32_t num, const char* ptr,
511  ParseContext* ctx) {
512  int size = ReadSize(&ptr);
514  if (unknown_ == nullptr) return ctx->Skip(ptr, size);
515  WriteVarint(num * 8 + 2, unknown_);
517  return ctx->AppendString(ptr, size, unknown_);
518  }
519  const char* ParseGroup(uint32_t num, const char* ptr, ParseContext* ctx) {
520  if (unknown_) WriteVarint(num * 8 + 3, unknown_);
521  ptr = ctx->ParseGroup(this, ptr, num * 8 + 3);
523  if (unknown_) WriteVarint(num * 8 + 4, unknown_);
524  return ptr;
525  }
527  if (unknown_ == nullptr) return;
528  WriteVarint(num * 8 + 5, unknown_);
529  char buffer[4];
531  value, reinterpret_cast<uint8_t*>(buffer));
532  unknown_->append(buffer, 4);
533  }
534 
535  const char* _InternalParse(const char* ptr, ParseContext* ctx) {
536  return WireFormatParser(*this, ptr, ctx);
537  }
538 
539  private:
541 };
542 
543 const char* UnknownGroupLiteParse(std::string* unknown, const char* ptr,
544  ParseContext* ctx) {
545  UnknownFieldLiteParserHelper field_parser(unknown);
546  return WireFormatParser(field_parser, ptr, ctx);
547 }
548 
549 const char* UnknownFieldParse(uint32_t tag, std::string* unknown,
550  const char* ptr, ParseContext* ctx) {
551  UnknownFieldLiteParserHelper field_parser(unknown);
552  return FieldParser(tag, field_parser, ptr, ctx);
553 }
554 
555 } // namespace internal
556 } // namespace protobuf
557 } // namespace google
558 
559 #include <google/protobuf/port_undef.inc>
xds_interop_client.str
str
Definition: xds_interop_client.py:487
ptr
char * ptr
Definition: abseil-cpp/absl/base/internal/low_level_alloc_test.cc:45
google::protobuf.internal::ReadTag
const char * ReadTag(const char *p, uint32 *out, uint32 max_tag=0)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:494
google::protobuf.internal::ParseContext::ReadSizeAndPushLimitAndDepth
const PROTOBUF_NODISCARD char * ReadSizeAndPushLimitAndDepth(const char *ptr, int *old_limit)
Definition: protobuf/src/google/protobuf/parse_context.cc:279
google::protobuf.internal::VarintParseSlow32
std::pair< const char *, uint32 > VarintParseSlow32(const char *p, uint32 res)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:340
google::protobuf::value
const Descriptor::ReservedRange value
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1954
google::protobuf.internal::ReadSize
uint32 ReadSize(const char **pp)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:561
google::protobuf.internal::EpsCopyInputStream::InitFrom
const char * InitFrom(StringPiece flat)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:217
ctx
Definition: benchmark-async.c:30
google::protobuf.internal::VarintParseSlow64
std::pair< const char *, uint64 > VarintParseSlow64(const char *p, uint32 res32)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:358
google::protobuf.internal::UnknownFieldLiteParserHelper::_InternalParse
const char * _InternalParse(const char *ptr, ParseContext *ctx)
Definition: protobuf/src/google/protobuf/parse_context.cc:535
begin
char * begin
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1007
google::protobuf.internal::ParseContext::ParseMessage
const PROTOBUF_MUST_USE_RESULT char * ParseMessage(T *msg, const char *ptr)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:597
grpc::protobuf::io::ZeroCopyInputStream
GRPC_CUSTOM_ZEROCOPYINPUTSTREAM ZeroCopyInputStream
Definition: include/grpcpp/impl/codegen/config_protobuf.h:101
google::protobuf.internal::byteswap< 4 >
void byteswap< 4 >(void *p)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:239
google::protobuf.internal::EpsCopyInputStream::SetEndOfStream
void SetEndOfStream()
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:191
GOOGLE_DCHECK
#define GOOGLE_DCHECK
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:194
google::protobuf.internal::UnknownGroupLiteParse
const char * UnknownGroupLiteParse(std::string *unknown, const char *ptr, ParseContext *ctx)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:600
google::protobuf.internal::UnknownFieldLiteParserHelper::UnknownFieldLiteParserHelper
UnknownFieldLiteParserHelper(std::string *unknown)
Definition: protobuf/src/google/protobuf/parse_context.cc:494
google::protobuf.internal::UnknownFieldParse
const char * UnknownFieldParse(uint32 tag, std::string *unknown, const char *ptr, ParseContext *ctx)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:606
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
google::protobuf.internal::PackedBoolParser
const char * PackedBoolParser(void *object, const char *ptr, ParseContext *ctx)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:512
google::protobuf.internal::ParseContext
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:336
google::protobuf
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:12
absl::FormatConversionChar::s
@ s
google::protobuf::io::CodedOutputStream::WriteLittleEndian64ToArray
static uint8 * WriteLittleEndian64ToArray(uint64 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:1618
xds_manager.p
p
Definition: xds_manager.py:60
google::protobuf::python::cdescriptor_pool::Add
static PyObject * Add(PyObject *self, PyObject *file_descriptor_proto)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:621
google::protobuf::MessageLite
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.h:184
google::protobuf.internal::UnknownFieldLiteParserHelper::unknown_
std::string * unknown_
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:597
uint8_t
unsigned char uint8_t
Definition: stdint-msvc2008.h:78
google::protobuf.internal::FixedParser
const char * FixedParser(void *object, const char *ptr, ParseContext *ctx)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:517
google::protobuf.internal::EpsCopyInputStream::kOnPatch
@ kOnPatch
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:256
google::protobuf.internal::EpsCopyInputStream::zcis_
io::ZeroCopyInputStream * zcis_
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:254
T
#define T(upbtypeconst, upbtype, ctype, default_value)
google::protobuf.internal::UnknownFieldLiteParserHelper::AddFixed32
void AddFixed32(uint32_t num, uint32_t value)
Definition: protobuf/src/google/protobuf/parse_context.cc:526
google::protobuf.internal::UnknownFieldLiteParserHelper::AddVarint
void AddVarint(uint32_t num, uint64_t value)
Definition: protobuf/src/google/protobuf/parse_context.cc:497
google::protobuf.internal::EpsCopyInputStream::aliasing_
std::uintptr_t aliasing_
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:257
google::protobuf.internal::PackedFixed64Parser
const char * PackedFixed64Parser(void *object, const char *ptr, ParseContext *ctx)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:532
google::protobuf.internal::UnknownFieldLiteParserHelper::ParseLengthDelimited
const char * ParseLengthDelimited(uint32_t num, const char *ptr, ParseContext *ctx)
Definition: protobuf/src/google/protobuf/parse_context.cc:510
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
google::protobuf.internal::byteswap< 1 >
void byteswap< 1 >(void *p)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:237
memcpy
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
google::protobuf.internal::EpsCopyInputStream::buffer_end_
const char * buffer_end_
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:250
end
char * end
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1008
google::protobuf.internal::PackedEnumParser
const char * PackedEnumParser(void *object, const char *ptr, ParseContext *ctx)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:478
tag
static void * tag(intptr_t t)
Definition: bad_client.cc:318
GOOGLE_PROTOBUF_PARSER_ASSERT
#define GOOGLE_PROTOBUF_PARSER_ASSERT(predicate)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:660
google::protobuf.internal::EpsCopyInputStream::PushLimit
PROTOBUF_MUST_USE_RESULT int PushLimit(const char *ptr, int limit)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:126
google::protobuf.internal::VarintParse
const PROTOBUF_MUST_USE_RESULT char * VarintParse(const char *p, T *out)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:471
google::protobuf.internal::WriteLengthDelimited
void WriteLengthDelimited(uint32 num, StringPiece val, std::string *s)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:334
uint64_t
unsigned __int64 uint64_t
Definition: stdint-msvc2008.h:90
google::protobuf.internal::PackedUInt64Parser
const char * PackedUInt64Parser(void *object, const char *ptr, ParseContext *ctx)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:465
google::protobuf.internal::EpsCopyInputStream::kNoDelta
@ kNoDelta
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:256
google::protobuf.internal::EpsCopyInputStream::AppendStringFallback
const char * AppendStringFallback(const char *ptr, int size, std::string *str)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:210
google::protobuf.internal::PackedSFixed32Parser
const char * PackedSFixed32Parser(void *object, const char *ptr, ParseContext *ctx)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:528
data
char data[kBufferLength]
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1006
buffer
char buffer[1024]
Definition: libuv/docs/code/idle-compute/main.c:8
uintptr_t
_W64 unsigned int uintptr_t
Definition: stdint-msvc2008.h:119
min
#define min(a, b)
Definition: qsort.h:83
google::protobuf.internal::EpsCopyInputStream::kSafeStringSize
@ kSafeStringSize
Definition: protobuf/src/google/protobuf/parse_context.h:287
google::protobuf.internal::InlineGreedyStringParser
const char * InlineGreedyStringParser(std::string *s, const char *ptr, ParseContext *ctx)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:420
google::protobuf.internal::VerifyUTF8
bool VerifyUTF8(StringPiece str, const char *field_name)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:412
google::protobuf.internal::FieldParser
const PROTOBUF_MUST_USE_RESULT char * FieldParser(uint64 tag, T &field_parser, const char *ptr, ParseContext *ctx)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:664
google::protobuf.internal::EpsCopyInputStream::PopLimit
PROTOBUF_MUST_USE_RESULT bool PopLimit(int delta)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:137
google::protobuf.internal::PackedInt64Parser
const char * PackedInt64Parser(void *object, const char *ptr, ParseContext *ctx)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:461
msg
std::string msg
Definition: client_interceptors_end2end_test.cc:372
google::protobuf.internal::PrintUTF8ErrorLog
void PrintUTF8ErrorLog(const char *field_name, const char *operation_str, bool emit_stacktrace)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.cc:571
google::protobuf.internal::EpsCopyInputStream::SkipFallback
const char * SkipFallback(const char *ptr, int size)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:195
google::protobuf.internal::EpsCopyInputStream::buffer_
char buffer_[2 *kSlopBytes]
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:255
google::protobuf.internal::PackedSFixed64Parser
const char * PackedSFixed64Parser(void *object, const char *ptr, ParseContext *ctx)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:536
google::protobuf.internal::PackedFloatParser
const char * PackedFloatParser(void *object, const char *ptr, ParseContext *ctx)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:540
google::protobuf.internal::PackedInt32Parser
const char * PackedInt32Parser(void *object, const char *ptr, ParseContext *ctx)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:453
google::protobuf.internal::EpsCopyInputStream::limit_end_
const char * limit_end_
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:249
google::protobuf.internal::UnknownFieldLiteParserHelper::ParseGroup
const char * ParseGroup(uint32_t num, const char *ptr, ParseContext *ctx)
Definition: protobuf/src/google/protobuf/parse_context.cc:519
google::protobuf.internal::EpsCopyInputStream::size_
int size_
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:252
google::protobuf.internal::EpsCopyInputStream::NextBuffer
const char * NextBuffer(int overrun, int depth)
Definition: protobuf/src/google/protobuf/parse_context.cc:102
google::protobuf.internal::ReadTagFallback
std::pair< const char *, uint32 > ReadTagFallback(const char *p, uint32 res)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:370
google::protobuf.internal::EpsCopyInputStream::Next
const char * Next()
Definition: protobuf/src/google/protobuf/parse_context.cc:157
google::protobuf.internal::IsStructurallyValidUTF8
PROTOBUF_EXPORT bool IsStructurallyValidUTF8(const char *buf, int len)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/structurally_valid.cc:556
google::protobuf::bswap_32
static uint32 bswap_32(uint32 x)
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/stubs/port.h:283
google::protobuf.internal::EpsCopyInputStream::kSlopBytes
@ kSlopBytes
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:109
google::protobuf.internal::EpsCopyInputStream::AppendSize
const char * AppendSize(const char *ptr, int size, const A &append)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:290
google::protobuf.internal::byteswap< 8 >
void byteswap< 8 >(void *p)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:243
xds_manager.num
num
Definition: xds_manager.py:56
google::protobuf.internal::ReadSizeFallback
std::pair< const char *, int32 > ReadSizeFallback(const char *p, uint32 res)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:381
google::protobuf.internal::PackedUInt32Parser
const char * PackedUInt32Parser(void *object, const char *ptr, ParseContext *ctx)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:457
google::protobuf.internal::PackedSInt64Parser
const char * PackedSInt64Parser(void *object, const char *ptr, ParseContext *ctx)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:473
google::protobuf.internal::EpsCopyInputStream::next_chunk_
const char * next_chunk_
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:251
google::protobuf.internal::PackedSInt32Parser
const char * PackedSInt32Parser(void *object, const char *ptr, ParseContext *ctx)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:469
google::protobuf.internal::EpsCopyInputStream::ReadStringFallback
const char * ReadStringFallback(const char *ptr, int size, std::string *str)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:199
google::protobuf.internal::EpsCopyInputStream::StreamNext
bool StreamNext(const void **data)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:279
google::protobuf.internal::ParseContext::depth_
int depth_
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:383
internal
Definition: benchmark/test/output_test_helper.cc:20
google::protobuf.internal::VarintParser
const char * VarintParser(void *object, const char *ptr, ParseContext *ctx)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:437
google::protobuf.internal::EpsCopyInputStream::DoneFallback
std::pair< const char *, bool > DoneFallback(const char *ptr, int d)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:157
google::protobuf.internal::byteswap
void byteswap(void *p)
google::protobuf.internal::PackedFixed32Parser
const char * PackedFixed32Parser(void *object, const char *ptr, ParseContext *ctx)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:524
google::protobuf.internal::StringParser
const char * StringParser(const char *begin, const char *end, void *object, ParseContext *)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:401
google::protobuf.internal::WriteVarint
void WriteVarint(uint64 val, std::string *s)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:320
google::protobuf.internal::WireFormatLite::ZigZagDecode64
static int64 ZigZagDecode64(uint64 n)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:885
size
voidpf void uLong size
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
mkowners.depth
depth
Definition: mkowners.py:114
int32_t
signed int int32_t
Definition: stdint-msvc2008.h:77
google::protobuf.internal::UnknownFieldLiteParserHelper::AddFixed64
void AddFixed64(uint32_t num, uint64_t value)
Definition: protobuf/src/google/protobuf/parse_context.cc:502
google::protobuf::bswap_64
static uint64 bswap_64(uint64 x)
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/stubs/port.h:293
google::protobuf.internal::EpsCopyInputStream::limit_
int limit_
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:253
google::protobuf.internal::WireFormatParser
const PROTOBUF_MUST_USE_RESULT char * WireFormatParser(T &field_parser, const char *ptr, ParseContext *ctx)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:711
google::protobuf.internal::WireFormatLite::ZigZagDecode32
static int32 ZigZagDecode32(uint32 n)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:874
binary_size.old
string old
Definition: binary_size.py:128
google
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:11
google::protobuf.internal::PackedDoubleParser
const char * PackedDoubleParser(void *object, const char *ptr, ParseContext *ctx)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:544
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
google::protobuf::io::CodedOutputStream::WriteLittleEndian32ToArray
static uint8 * WriteLittleEndian32ToArray(uint32 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:1605
google::protobuf.internal::EpsCopyInputStream::overall_limit_
int overall_limit_
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:272
RepeatedField
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:403


grpc
Author(s):
autogenerated on Fri May 16 2025 02:59:39