Internal Code Change

PiperOrigin-RevId: 532148865
pull/12800/head
Mike Kruskal 2 years ago committed by Copybara-Service
parent 191f4be064
commit fc7454acf8
  1. 3
      src/google/protobuf/compiler/retention.cc
  2. 3
      src/google/protobuf/retention_test.cc

@ -299,8 +299,7 @@ MessageOptions StripLocalSourceRetentionOptions(const Descriptor& descriptor) {
ExtensionRangeOptions StripLocalSourceRetentionOptions( ExtensionRangeOptions StripLocalSourceRetentionOptions(
const Descriptor& descriptor, const Descriptor::ExtensionRange& range) { const Descriptor& descriptor, const Descriptor::ExtensionRange& range) {
if (range.options_ == nullptr) return ExtensionRangeOptions{}; ExtensionRangeOptions options = range.options();
ExtensionRangeOptions options = *range.options_;
ConvertToDynamicMessageAndStripOptions(options, GetPool(descriptor)); ConvertToDynamicMessageAndStripOptions(options, GetPool(descriptor));
return options; return options;
} }

@ -160,7 +160,8 @@ TEST(RetentionTest, ExtensionRange) {
CheckOptionsMessageIsStrippedCorrectly( CheckOptionsMessageIsStrippedCorrectly(
protobuf_unittest::TopLevelMessage::descriptor() protobuf_unittest::TopLevelMessage::descriptor()
->extension_range(0) ->extension_range(0)
->options_->GetExtension(protobuf_unittest::extension_range_option)); ->options()
.GetExtension(protobuf_unittest::extension_range_option));
} }
TEST(RetentionTest, Service) { TEST(RetentionTest, Service) {

Loading…
Cancel
Save