diff options
| author | pg <[email protected]> | 2023-02-08 14:47:59 +0300 |
|---|---|---|
| committer | pg <[email protected]> | 2023-02-08 14:47:59 +0300 |
| commit | 2999295666a93b51c9226cee88ea70b996d43727 (patch) | |
| tree | 6cd1a5290a2653689a33c6269c0eebb7dd05729d /contrib/libs/protoc/src/google/protobuf/compiler/parser.cc | |
| parent | e615f3f87f0fc3dcc0d45c304883339ab1eab8c1 (diff) | |
3.19.0
Diffstat (limited to 'contrib/libs/protoc/src/google/protobuf/compiler/parser.cc')
| -rw-r--r-- | contrib/libs/protoc/src/google/protobuf/compiler/parser.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/parser.cc b/contrib/libs/protoc/src/google/protobuf/compiler/parser.cc index 03b00dd0e8f..335edcf30c9 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/parser.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/parser.cc @@ -1514,6 +1514,13 @@ bool Parser::ParseOption(Message* options, AddError("Unexpected end of stream while parsing option value."); return false; + case io::Tokenizer::TYPE_WHITESPACE: + case io::Tokenizer::TYPE_NEWLINE: + GOOGLE_CHECK(!input_->report_whitespace() && !input_->report_newlines()) + << "Whitespace tokens were not requested."; + GOOGLE_LOG(FATAL) << "Tokenizer reported whitespace."; + return false; + case io::Tokenizer::TYPE_IDENTIFIER: { value_location.AddPath( UninterpretedOption::kIdentifierValueFieldNumber); @@ -1538,7 +1545,7 @@ bool Parser::ParseOption(Message* options, value_location.AddPath( UninterpretedOption::kNegativeIntValueFieldNumber); uninterpreted_option->set_negative_int_value( - static_cast<arc_i64>(-value)); + static_cast<arc_i64>(0 - value)); } else { value_location.AddPath( UninterpretedOption::kPositiveIntValueFieldNumber); |
