[ 
https://issues.apache.org/jira/browse/THRIFT-3885?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15390962#comment-15390962
 ] 

ASF GitHub Bot commented on THRIFT-3885:
----------------------------------------

Github user nsuke commented on the issue:

    https://github.com/apache/thrift/pull/1052
  
    I'm inclined to make it stupid simple...
    ``` php
    // Shift hi and lo together.
    if ($shift < 28) {
      $lo |= (($byte & 0x7f) << $shift);
    } elseif ($shift == 28) {
      $lo |= (($byte & 0x0f) << 28);
      $hi |= (($byte & 0x70) >> 4);
    } else {
      $hi |= (($byte & 0x7f) << ($shift - 32));
    }
    ```
    @czm1989 @lnn1123 Thought ?
    Otherwise I'd apply @lnn1123 's patch but keeping `> 25`.



> PHP: Error when readI64 in TCompactProtocol
> -------------------------------------------
>
>                 Key: THRIFT-3885
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3885
>             Project: Thrift
>          Issue Type: Bug
>          Components: PHP - Library
>    Affects Versions: 0.7, 0.8, 0.9, 0.9.1, 0.9.2, 0.9.3
>         Environment: all
>            Reporter: Chen Zhiming
>              Labels: patch
>
> In line 618 of readI64 of TCompactProtocol, the number of shift bit is error. 
> It must be
> $hi |= (($byte & 0x7f) >> (7 - ($shift - 25)));



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to