Fix case of locality optimizer being wrong for split repeated fields and add a check that the optimized order has the same size as the unoptimized order.

PiperOrigin-RevId: 543779555
pull/13153/head
Protobuf Team Bot 1 year ago committed by Copybara-Service
parent ee5cf35c1a
commit 76a327e1e1
  1. 2
      src/google/protobuf/compiler/cpp/message.cc

@ -547,8 +547,10 @@ MessageGenerator::MessageGenerator(
}
}
const size_t initial_size = optimized_order_.size();
message_layout_helper_->OptimizeLayout(&optimized_order_, options_,
scc_analyzer_);
ABSL_CHECK_EQ(initial_size, optimized_order_.size());
// This message has hasbits iff one or more fields need one.
for (auto field : optimized_order_) {

Loading…
Cancel
Save