Skip to content

Commit

Permalink
Add debug check for field not being extension in HasBitIndex().
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 718998148
  • Loading branch information
ClaytonKnittel authored and copybara-github committed Jan 23, 2025
1 parent 7f7e5ba commit 7878682
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/google/protobuf/generated_message_reflection.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ struct ReflectionSchema {

// Bit index within the bit array of hasbits. Bit order is low-to-high.
uint32_t HasBitIndex(const FieldDescriptor* field) const {
ABSL_DCHECK(!field->is_extension());
if (has_bits_offset_ == -1) return static_cast<uint32_t>(-1);
ABSL_DCHECK(HasHasbits());
return has_bit_indices_[field->index()];
Expand Down

0 comments on commit 7878682

Please sign in to comment.