diff options
author | Adam Cozzette <acozzette@google.com> | 2016-11-17 17:04:30 -0800 |
---|---|---|
committer | Adam Cozzette <acozzette@google.com> | 2016-11-17 17:04:30 -0800 |
commit | 5d63097fc2b7f405f53d6ca4ad3c1ebd98d80ddd (patch) | |
tree | 50d8116271f024e16334785464c794da85f3ce12 /php/src/Google/Protobuf/Internal/Message.php | |
parent | 5a76e633ea9b5adb215e93fdc11e1c0c08b3fc74 (diff) | |
parent | cd315dcbadc02569e145bde16e3f66c2fbb08e31 (diff) | |
download | protobuf-5d63097fc2b7f405f53d6ca4ad3c1ebd98d80ddd.tar.gz protobuf-5d63097fc2b7f405f53d6ca4ad3c1ebd98d80ddd.tar.bz2 protobuf-5d63097fc2b7f405f53d6ca4ad3c1ebd98d80ddd.zip |
Merge branch 'master' into down-integrate-with-msvc-fix
Diffstat (limited to 'php/src/Google/Protobuf/Internal/Message.php')
-rw-r--r-- | php/src/Google/Protobuf/Internal/Message.php | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/php/src/Google/Protobuf/Internal/Message.php b/php/src/Google/Protobuf/Internal/Message.php index 7bdc6a8c..3d1f1598 100644 --- a/php/src/Google/Protobuf/Internal/Message.php +++ b/php/src/Google/Protobuf/Internal/Message.php @@ -125,6 +125,16 @@ class Message $oneof = $this->desc->getOneofDecl()[$field->getOneofIndex()]; $oneof_name = $oneof->getName(); $this->$oneof_name = new OneofField($oneof); + } else if ($field->getLabel() === GPBLabel::OPTIONAL && + PHP_INT_SIZE == 4) { + switch ($field->getType()) { + case GPBType::INT64: + case GPBType::UINT64: + case GPBType::FIXED64: + case GPBType::SFIXED64: + case GPBType::SINT64: + $this->$setter("0"); + } } } } @@ -210,13 +220,11 @@ class Message if (!GPBWire::readInt64($input, $value)) { return false; } - $value = $value->toInteger(); break; case GPBType::UINT64: if (!GPBWire::readUint64($input, $value)) { return false; } - $value = $value->toInteger(); break; case GPBType::INT32: if (!GPBWire::readInt32($input, $value)) { @@ -227,7 +235,6 @@ class Message if (!GPBWire::readFixed64($input, $value)) { return false; } - $value = $value->toInteger(); break; case GPBType::FIXED32: if (!GPBWire::readFixed32($input, $value)) { @@ -285,7 +292,6 @@ class Message if (!GPBWire::readSfixed64($input, $value)) { return false; } - $value = $value->toInteger(); break; case GPBType::SINT32: if (!GPBWire::readSint32($input, $value)) { @@ -296,7 +302,6 @@ class Message if (!GPBWire::readSint64($input, $value)) { return false; } - $value = $value->toInteger(); break; default: user_error("Unsupported type."); |