diff options
author | Paul Yang <TeBoring@users.noreply.github.com> | 2017-02-07 21:33:28 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-07 21:33:28 -0800 |
commit | 2edf2bdebf1ede582b816a521ad6e51a802eaa46 (patch) | |
tree | d1a408c6ea5a3c32306864d1b96d7708bdb0e120 /php/src/Google/Protobuf/Internal/Message.php | |
parent | c7f4c7bc417a24eeb7d5ac10a91b85b2df8a0b41 (diff) | |
download | protobuf-2edf2bdebf1ede582b816a521ad6e51a802eaa46.tar.gz protobuf-2edf2bdebf1ede582b816a521ad6e51a802eaa46.tar.bz2 protobuf-2edf2bdebf1ede582b816a521ad6e51a802eaa46.zip |
Bug fix: When encoding, negative int32 values should be padded to int64 (#2660)
in order to be wire compatible.
Diffstat (limited to 'php/src/Google/Protobuf/Internal/Message.php')
-rw-r--r-- | php/src/Google/Protobuf/Internal/Message.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/php/src/Google/Protobuf/Internal/Message.php b/php/src/Google/Protobuf/Internal/Message.php index f6be8500..43525c58 100644 --- a/php/src/Google/Protobuf/Internal/Message.php +++ b/php/src/Google/Protobuf/Internal/Message.php @@ -582,9 +582,11 @@ class Message case GPBType::SFIXED64: $size += 8; break; - case GPBType::UINT32: case GPBType::INT32: case GPBType::ENUM: + $size += GPBWire::varint32Size($value, true); + break; + case GPBType::UINT32: $size += GPBWire::varint32Size($value); break; case GPBType::UINT64: |