Internal changes

PiperOrigin-RevId: 533624998
pull/12867/head
Mike Kruskal 2 years ago committed by Copybara-Service
parent afd4971110
commit bec4585d3d
  1. 7
      src/google/protobuf/compiler/command_line_interface.cc
  2. 1
      src/google/protobuf/compiler/command_line_interface_unittest.cc

@ -1306,8 +1306,11 @@ int CommandLineInterface::Run(int argc, const char* const argv[]) {
// something like descriptor->file()->name(), but ExtensionRange does not // something like descriptor->file()->name(), but ExtensionRange does not
// support this. // support this.
for (const google::protobuf::FileDescriptor* file : parsed_files) { for (const google::protobuf::FileDescriptor* file : parsed_files) {
google::protobuf::internal::VisitDescriptors(*file, [&](const auto& descriptor) { FileDescriptorProto proto;
if (!ValidateTargetConstraints(descriptor.options(), *descriptor_pool, file->CopyTo(&proto);
google::protobuf::internal::VisitDescriptors(
*file, proto, [&](const auto& descriptor, const auto& proto) {
if (!ValidateTargetConstraints(proto.options(), *descriptor_pool,
*error_collector, file->name(), *error_collector, file->name(),
GetTargetType(&descriptor))) { GetTargetType(&descriptor))) {
validation_error = true; validation_error = true;

@ -1419,6 +1419,7 @@ TEST_F(CommandLineInterfaceTest, AllowServicesHasService) {
} }
TEST_F(CommandLineInterfaceTest, DirectDependencies_Missing_EmptyList) { TEST_F(CommandLineInterfaceTest, DirectDependencies_Missing_EmptyList) {
CreateTempFile("foo.proto", CreateTempFile("foo.proto",
"syntax = \"proto2\";\n" "syntax = \"proto2\";\n"

Loading…
Cancel
Save