aboutsummaryrefslogtreecommitdiffhomepage
path: root/php/src/Google/Protobuf/Internal/Message.php
diff options
context:
space:
mode:
authorGravatar Paul Yang <TeBoring@users.noreply.github.com>2017-02-07 21:33:28 -0800
committerGravatar Paul Yang <TeBoring@users.noreply.github.com>2017-03-15 14:16:49 -0700
commitf23869c6154d8b083ee3417fac277bc25e13a4ac (patch)
tree2e9ea1cfcc88211ac1e364155d696c808acb11ba /php/src/Google/Protobuf/Internal/Message.php
parent014a5507fb4b1ccc12f35ff313b8a04c05d69b7f (diff)
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 ca4fde02..887c86ca 100644
--- a/php/src/Google/Protobuf/Internal/Message.php
+++ b/php/src/Google/Protobuf/Internal/Message.php
@@ -772,9 +772,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: