Skip to content

Commit 41aa8e1

Browse files
committed
Update from upstream
1 parent 1475367 commit 41aa8e1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Thrift/Protocol/TCompactProtocol.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ class TCompactProtocol extends TProtocol {
6161
const VERSION = 1;
6262
const PROTOCOL_ID = 0x82;
6363
const TYPE_MASK = 0xe0;
64+
const TYPE_BITS = 0x07;
6465
const TYPE_SHIFT_AMOUNT = 5;
6566

6667
protected static $ctypes = array(
@@ -381,8 +382,7 @@ public function readMessageBegin(&$name, &$type, &$seqid) {
381382
}
382383
$verType = 0;
383384
$result += $this->readUByte($verType);
384-
$type = ($verType & TCompactProtocol::TYPE_MASK) >>
385-
TCompactProtocol::TYPE_SHIFT_AMOUNT;
385+
$type = ($verType >> TCompactProtocol::TYPE_SHIFT_AMOUNT) & TCompactProtocol::TYPE_BITS;
386386
$version = $verType & TCompactProtocol::VERSION_MASK;
387387
if ($version != TCompactProtocol::VERSION) {
388388
throw new TProtocolException('Bad version in TCompact message');

0 commit comments

Comments
 (0)