luffy-zh commented on code in PR #2317:
URL: https://github.com/apache/orc/pull/2317#discussion_r2196753013


##########
c++/src/RLE.cc:
##########
@@ -77,9 +77,9 @@ namespace orc {
     add<int16_t>(data, numValues, notNull);
   }
 
-  NO_SANITIZE_ATTR
   void RleEncoder::writeVslong(int64_t val) {
-    writeVulong((val << 1) ^ (val >> 63));
+    uint64_t uval = static_cast<uint64_t>(val);
+    writeVulong((uval << 1) ^ (static_cast<int64_t>(uval) >> 63));

Review Comment:
   Uval is of type uint64_t, and shifting it directly with >> 63 would perform 
a logical shift (zero-fill).
   However, we need a sign extension (i.e., fill with copies of the sign bit), 
which only happens with signed types.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to