Unverified Commit 239dba53 authored by Thomas Van Lenten's avatar Thomas Van Lenten Committed by GitHub

Merge pull request #3839 from thomasvl/message_equality

When comparing message, require them to have the same descriptor.
parents cbe25059 1f57e540
...@@ -2591,13 +2591,14 @@ static void MergeRepeatedNotPackedFieldFromCodedInputStream( ...@@ -2591,13 +2591,14 @@ static void MergeRepeatedNotPackedFieldFromCodedInputStream(
if (other == self) { if (other == self) {
return YES; return YES;
} }
if (![other isKindOfClass:[self class]] && if (![other isKindOfClass:[GPBMessage class]]) {
![self isKindOfClass:[other class]]) {
return NO; return NO;
} }
GPBMessage *otherMsg = other; GPBMessage *otherMsg = other;
GPBDescriptor *descriptor = [[self class] descriptor]; GPBDescriptor *descriptor = [[self class] descriptor];
if ([[otherMsg class] descriptor] != descriptor) {
return NO;
}
uint8_t *selfStorage = (uint8_t *)messageStorage_; uint8_t *selfStorage = (uint8_t *)messageStorage_;
uint8_t *otherStorage = (uint8_t *)otherMsg->messageStorage_; uint8_t *otherStorage = (uint8_t *)otherMsg->messageStorage_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment