aboutsummaryrefslogtreecommitdiffhomepage
path: root/objectivec/GPBMessage.m
diff options
context:
space:
mode:
authorGravatar Thomas Van Lenten <thomasvl@google.com>2018-01-03 11:19:53 -0500
committerGravatar Thomas Van Lenten <thomasvl@google.com>2018-01-03 11:46:03 -0500
commit156161dfcde38b72c55ead02cacff7087c93a4d8 (patch)
treef2c3f5e9b754514d5cf4422c2959ad6fc1eae03b /objectivec/GPBMessage.m
parent8529f2aee33ae793c9ce362a45370b98f675370a (diff)
Properly copy maps with string keys but pod values.
Add tests to cover all the common special casing in the runtime code to ensure things come out correctly.
Diffstat (limited to 'objectivec/GPBMessage.m')
-rw-r--r--objectivec/GPBMessage.m3
1 files changed, 2 insertions, 1 deletions
diff --git a/objectivec/GPBMessage.m b/objectivec/GPBMessage.m
index 90485bd1..3be20b67 100644
--- a/objectivec/GPBMessage.m
+++ b/objectivec/GPBMessage.m
@@ -969,7 +969,8 @@ static GPBUnknownFieldSet *GetOrMakeUnknownFields(GPBMessage *self) {
newValue = [value copyWithZone:zone];
}
} else {
- if (field.mapKeyDataType == GPBDataTypeString) {
+ if ((field.mapKeyDataType == GPBDataTypeString) &&
+ GPBFieldDataTypeIsObject(field)) {
// NSDictionary
newValue = [value mutableCopyWithZone:zone];
} else {