From 15a0d5b599b125aab6aa4b89f222f4c0d32c6b73 Mon Sep 17 00:00:00 2001 From: Mike Kruskal Date: Fri, 8 Dec 2023 14:55:28 -0800 Subject: [PATCH] Internal change PiperOrigin-RevId: 589249653 --- src/google/protobuf/compiler/parser_unittest.cc | 1 + src/google/protobuf/descriptor.cc | 1 + 2 files changed, 2 insertions(+) diff --git a/src/google/protobuf/compiler/parser_unittest.cc b/src/google/protobuf/compiler/parser_unittest.cc index fca35845b5..89e04d98c5 100644 --- a/src/google/protobuf/compiler/parser_unittest.cc +++ b/src/google/protobuf/compiler/parser_unittest.cc @@ -118,6 +118,7 @@ class ParserTest : public testing::Test { // We don't cover SourceCodeInfo in these tests. actual.clear_source_code_info(); + // Parse the ASCII representation in order to canonicalize it. We could // just compare directly to actual.DebugString(), but that would require // that the caller precisely match the formatting that DebugString() diff --git a/src/google/protobuf/descriptor.cc b/src/google/protobuf/descriptor.cc index 95a341bd3d..6599830c64 100644 --- a/src/google/protobuf/descriptor.cc +++ b/src/google/protobuf/descriptor.cc @@ -2739,6 +2739,7 @@ FileDescriptor::FileDescriptor() {} void FileDescriptor::CopyTo(FileDescriptorProto* proto) const { CopyHeadingTo(proto); + for (int i = 0; i < dependency_count(); i++) { proto->add_dependency(dependency(i)->name()); }