diff --git a/src/google/protobuf/compiler/cpp/parse_function_generator.cc b/src/google/protobuf/compiler/cpp/parse_function_generator.cc index 0f1d767c816b9..7bd4cec3ae1e9 100644 --- a/src/google/protobuf/compiler/cpp/parse_function_generator.cc +++ b/src/google/protobuf/compiler/cpp/parse_function_generator.cc @@ -1371,7 +1371,7 @@ void ParseFunctionGenerator::GenerateFieldBody( format.Set("enum_type", QualifiedClassName(field->enum_type(), options_)); format( - "$uint64$ val = ::$proto_ns$::internal::ReadVarint64(&ptr);\n" + "$int32$ val = ::$proto_ns$::internal::ReadVarint32(&ptr);\n" "CHK_(ptr);\n"); if (!HasPreservingUnknownEnumSemantics(field)) { format("if (PROTOBUF_PREDICT_TRUE($enum_type$_IsValid(val))) {\n");