aboutsummaryrefslogtreecommitdiff
path: root/php/src/Google/Protobuf/Internal/Message.php
diff options
context:
space:
mode:
authorPaul Yang <TeBoring@users.noreply.github.com>2017-02-07 21:33:28 -0800
committerGitHub <noreply@github.com>2017-02-07 21:33:28 -0800
commit2edf2bdebf1ede582b816a521ad6e51a802eaa46 (patch)
treed1a408c6ea5a3c32306864d1b96d7708bdb0e120 /php/src/Google/Protobuf/Internal/Message.php
parentc7f4c7bc417a24eeb7d5ac10a91b85b2df8a0b41 (diff)
downloadprotobuf-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.php4
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: