royale-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com.INVALID>
Subject Re: [royale-asjs] branch develop updated: Shifting 24 bits converted to negative int value
Date Mon, 25 Jun 2018 06:07:07 GMT
FWIW, this does not make sense.  Shifting to the left shouldn't cause sign-bit extending. 
 I suppose it could shift a 1 into the sign bit, but that implies a signed int read, or the
data was out of range.

Of course, I could be wrong...
-Alex

´╗┐On 6/24/18, 12:25 PM, "harbs@apache.org" <harbs@apache.org> wrote:

    This is an automated email from the ASF dual-hosted git repository.
    
    harbs pushed a commit to branch develop
    in repository https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&data=02%7C01%7Caharui%40adobe.com%7Ce941b0896db44fa2127c08d5da08491f%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C1%7C636654651499005568&sdata=h3WWynmXGQXTRqmzte46oprTRzZf0abvL7cfCEmSgZA%3D&reserved=0
    
    
    The following commit(s) were added to refs/heads/develop by this push:
         new ce95546  Shifting 24 bits converted to negative int value
    ce95546 is described below
    
    commit ce95546395ade51c63ba9b8a9cff7c63477b8c4a
    Author: Harbs <harbs@in-tools.com>
    AuthorDate: Sun Jun 24 22:25:37 2018 +0300
    
        Shifting 24 bits converted to negative int value
    ---
     .../Core/src/main/royale/org/apache/royale/utils/BinaryData.as        | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/BinaryData.as
b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/BinaryData.as
    index c430369..fad4ea3 100644
    --- a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/BinaryData.as
    +++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/BinaryData.as
    @@ -665,9 +665,9 @@ public class BinaryData implements IBinaryDataInput, IBinaryDataOutput
             {
                 var arr:Uint8Array = getTypedArray();
                 if(endian == Endian.BIG_ENDIAN){
    -                return (arr[_position++] << 24) + (arr[_position++] << 16)
+ ( arr[_position++] << 8) + arr[_position++];
    +                return (arr[_position++] * 16777216) + (arr[_position++] << 16)
+ ( arr[_position++] << 8) + arr[_position++];
                 } else {
    -                return arr[_position++] + ( arr[_position++] << 8) + (arr[_position++]
<< 16) + (arr[_position++] << 24)
    +                return arr[_position++] + ( arr[_position++] << 8) + (arr[_position++]
<< 16) + (arr[_position++] * 16777216)
                 }
             }
         }
    
    

Mime
View raw message