Merge pull request #3839 from thomasvl/message_equality

When comparing message, require them to have the same descriptor.
pull/3563/merge
Thomas Van Lenten 7 years ago committed by GitHub
commit 239dba535c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      objectivec/GPBMessage.m

@ -2591,13 +2591,14 @@ static void MergeRepeatedNotPackedFieldFromCodedInputStream(
if (other == self) {
return YES;
}
if (![other isKindOfClass:[self class]] &&
![self isKindOfClass:[other class]]) {
if (![other isKindOfClass:[GPBMessage class]]) {
return NO;
}
GPBMessage *otherMsg = other;
GPBDescriptor *descriptor = [[self class] descriptor];
if ([[otherMsg class] descriptor] != descriptor) {
return NO;
}
uint8_t *selfStorage = (uint8_t *)messageStorage_;
uint8_t *otherStorage = (uint8_t *)otherMsg->messageStorage_;

Loading…
Cancel
Save