Skip to content

Commit

Permalink
Internal change.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 656154926
  • Loading branch information
congliuthu authored and copybara-github committed Sep 4, 2024
1 parent 5d34147 commit acdc4ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/google/protobuf/generated_message_reflection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2591,6 +2591,7 @@ void* Reflection::MutableRawRepeatedField(Message* message,
const Descriptor* desc) const {
(void)ctype; // Parameter is used by Google-internal code.
USAGE_CHECK_REPEATED("MutableRawRepeatedField");
USAGE_CHECK_MESSAGE_TYPE(MutableRawRepeatedField);

if (field->cpp_type() != cpptype &&
(field->cpp_type() != FieldDescriptor::CPPTYPE_ENUM ||
Expand Down Expand Up @@ -2618,6 +2619,7 @@ const void* Reflection::GetRawRepeatedField(const Message& message,
int ctype,
const Descriptor* desc) const {
USAGE_CHECK_REPEATED("GetRawRepeatedField");
USAGE_CHECK_MESSAGE_TYPE(GetRawRepeatedField);
if (field->cpp_type() != cpptype &&
(field->cpp_type() != FieldDescriptor::CPPTYPE_ENUM ||
cpptype != FieldDescriptor::CPPTYPE_INT32))
Expand Down
1 change: 1 addition & 0 deletions src/google/protobuf/message.h
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ class PROTOBUF_EXPORT Reflection final {

// Returns true if the given message is a default message instance.
bool IsDefaultInstance(const Message& message) const {
ABSL_DCHECK_EQ(message.GetReflection(), this);
return schema_.IsDefaultInstance(message);
}

Expand Down

0 comments on commit acdc4ff

Please sign in to comment.