Jim Apple has posted comments on this change.

Change subject: IMPALA-5031: Remove undefined behavior: left shift of negative 
values
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/6491/1/be/src/exec/read-write-util.cc
File be/src/exec/read-write-util.cc:

Line 96:   uint32_t uinteger = (static_cast<uint32_t>(integer) << 1) ^ (integer 
>> 31);
> Since we're operating on uints anyway it might be clearer to convert to a u
That's what I thought, too, but it doesn't work: the right shift depends on 
signed shifting semantics to shift in 1s at the most-significant bits when the 
value is negative.


-- 
To view, visit http://gerrit.cloudera.org:8080/6491
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I9d965c3950a878c0a41b374d51bbe2e5705b3360
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Jim Apple <[email protected]>
Gerrit-Reviewer: Dan Hecht <[email protected]>
Gerrit-Reviewer: Jim Apple <[email protected]>
Gerrit-Reviewer: Tim Armstrong <[email protected]>
Gerrit-HasComments: Yes

Reply via email to