Skip to content

Commit

Permalink
Fix typos in parse_context.h.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 645498562
  • Loading branch information
protobuf-github-bot authored and copybara-github committed Jun 21, 2024
1 parent 7d395b8 commit 0302c4c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/google/protobuf/parse_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class PROTOBUF_EXPORT EpsCopyInputStream {

// In sanitizer mode we use memory poisoning to guarantee that:
// - We do not read an uninitialized token.
// - We would like to verify that this token was consumed, but unforuntately
// - We would like to verify that this token was consumed, but unfortunately
// __asan_address_is_poisoned is allowed to have false negatives.
class LimitToken {
public:
Expand Down Expand Up @@ -256,17 +256,17 @@ class PROTOBUF_EXPORT EpsCopyInputStream {
bool DataAvailable(const char* ptr) { return ptr < limit_end_; }

protected:
// Returns true is limit (either an explicit limit or end of stream) is
// Returns true if limit (either an explicit limit or end of stream) is
// reached. It aligns *ptr across buffer seams.
// If limit is exceeded it returns true and ptr is set to null.
// If limit is exceeded, it returns true and ptr is set to null.
bool DoneWithCheck(const char** ptr, int d) {
ABSL_DCHECK(*ptr);
if (PROTOBUF_PREDICT_TRUE(*ptr < limit_end_)) return false;
int overrun = static_cast<int>(*ptr - buffer_end_);
ABSL_DCHECK_LE(overrun, kSlopBytes); // Guaranteed by parse loop.
if (overrun ==
limit_) { // No need to flip buffers if we ended on a limit.
// If we actually overrun the buffer and next_chunk_ is null. It means
// If we actually overrun the buffer and next_chunk_ is null, it means
// the stream ended and we passed the stream end.
if (overrun > 0 && next_chunk_ == nullptr) *ptr = nullptr;
return true;
Expand Down

0 comments on commit 0302c4c

Please sign in to comment.