Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.9
-
Windows
-
Patch Available
Description
longToZigzag and ZigzagToLong in TCompactProtocol does not perform corresponding operations to serialize and deserialize negative int32 and int64 number correctly. Purpose to change longToZigzag from (ulong)(((ulong)n << 1) ^ ((ulong)n >> 63)) to (ulong)(n << 1) ^ (ulong)(n >> 63).
Will need to do same for intToZigZag. The reason is that we want arithmetic shift not logic shift.
The test case in the project shows this, the output on server and client are different even though client received the same number back.
Attachments
Attachments
Issue Links
- is duplicated by
-
THRIFT-2047 Thrift.Protocol.TCompactProtocol, intToZigZag data lost (TCompactProtocol.cs)
- Closed