diff --git a/src/google/protobuf/compiler/parser.cc b/src/google/protobuf/compiler/parser.cc index afe9d4ff08..49ddfceb1a 100644 --- a/src/google/protobuf/compiler/parser.cc +++ b/src/google/protobuf/compiler/parser.cc @@ -1549,7 +1549,7 @@ bool Parser::ParseOption(Message* options, value_location.AddPath( UninterpretedOption::kNegativeIntValueFieldNumber); uninterpreted_option->set_negative_int_value( - static_cast(-value)); + static_cast(0 - value)); } else { value_location.AddPath( UninterpretedOption::kPositiveIntValueFieldNumber);