diff options
author | Thomas Van Lenten <thomasvl@google.com> | 2017-06-01 14:25:45 -0400 |
---|---|---|
committer | Thomas Van Lenten <thomasvl@google.com> | 2017-06-01 14:25:45 -0400 |
commit | 46f36d79a21474dcb9212252cec2c59ca245ac17 (patch) | |
tree | ae3be6602212f0bf73fc48283f2944f61404a756 | |
parent | d6470abef1ca76c40e6da3b4445b7c32f1d0e2e3 (diff) |
Fix some cases of reading of 64bit map values.
-rw-r--r-- | objectivec/GPBDictionary.m | 2 | ||||
-rw-r--r-- | objectivec/Tests/GPBMessageTests+Serialization.m | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/objectivec/GPBDictionary.m b/objectivec/GPBDictionary.m index 1c67c680..a7a8871b 100644 --- a/objectivec/GPBDictionary.m +++ b/objectivec/GPBDictionary.m @@ -406,7 +406,7 @@ static void ReadValue(GPBCodedInputStream *stream, valueToFill->valueInt32 = GPBCodedInputStreamReadInt32(&stream->state_); break; case GPBDataTypeInt64: - valueToFill->valueInt64 = GPBCodedInputStreamReadInt32(&stream->state_); + valueToFill->valueInt64 = GPBCodedInputStreamReadInt64(&stream->state_); break; case GPBDataTypeSInt32: valueToFill->valueInt32 = GPBCodedInputStreamReadSInt32(&stream->state_); diff --git a/objectivec/Tests/GPBMessageTests+Serialization.m b/objectivec/Tests/GPBMessageTests+Serialization.m index 3c861fef..38da0d77 100644 --- a/objectivec/Tests/GPBMessageTests+Serialization.m +++ b/objectivec/Tests/GPBMessageTests+Serialization.m @@ -1149,22 +1149,27 @@ static NSData *DataFromCStr(const char *str) { [msg.mapInt32Int32 setInt32:101 forKey:2001]; [msg.mapInt64Int64 setInt64:1002 forKey:202]; [msg.mapInt64Int64 setInt64:103 forKey:2003]; + [msg.mapInt64Int64 setInt64:4294967296 forKey:4294967297]; [msg.mapUint32Uint32 setUInt32:1004 forKey:204]; [msg.mapUint32Uint32 setUInt32:105 forKey:2005]; [msg.mapUint64Uint64 setUInt64:1006 forKey:206]; [msg.mapUint64Uint64 setUInt64:107 forKey:2007]; + [msg.mapUint64Uint64 setUInt64:4294967298 forKey:4294967299]; [msg.mapSint32Sint32 setInt32:1008 forKey:208]; [msg.mapSint32Sint32 setInt32:109 forKey:2009]; [msg.mapSint64Sint64 setInt64:1010 forKey:210]; [msg.mapSint64Sint64 setInt64:111 forKey:2011]; + [msg.mapSint64Sint64 setInt64:4294967300 forKey:4294967301]; [msg.mapFixed32Fixed32 setUInt32:1012 forKey:212]; [msg.mapFixed32Fixed32 setUInt32:113 forKey:2013]; [msg.mapFixed64Fixed64 setUInt64:1014 forKey:214]; [msg.mapFixed64Fixed64 setUInt64:115 forKey:2015]; + [msg.mapFixed64Fixed64 setUInt64:4294967302 forKey:4294967303]; [msg.mapSfixed32Sfixed32 setInt32:1016 forKey:216]; [msg.mapSfixed32Sfixed32 setInt32:117 forKey:2017]; [msg.mapSfixed64Sfixed64 setInt64:1018 forKey:218]; [msg.mapSfixed64Sfixed64 setInt64:119 forKey:2019]; + [msg.mapSfixed64Sfixed64 setInt64:4294967304 forKey:4294967305]; [msg.mapInt32Float setFloat:1020.f forKey:220]; [msg.mapInt32Float setFloat:121.f forKey:2021]; [msg.mapInt32Double setDouble:1022. forKey:222]; |