From 156161dfcde38b72c55ead02cacff7087c93a4d8 Mon Sep 17 00:00:00 2001 From: Thomas Van Lenten Date: Wed, 3 Jan 2018 11:19:53 -0500 Subject: 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. --- objectivec/GPBMessage.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'objectivec/GPBMessage.m') 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 { -- cgit v1.2.3