ilovesoup / hyracks

Automatically exported from code.google.com/p/hyracks
Apache License 2.0
0 stars 0 forks source link

ShortPointable Bad Byte Offset Values #80

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Short value stored in a ShortPointable is not returned with getShort 
function call.
2. The patch code is below for changes to the bit offset.
3. Found in the hyracks_asterix_stabilization branch.

What is the expected output? What do you see instead?

It appears the bit offset values are off for the short size.

Patch Code:

     public static void setShort(byte[] bytes, int start, short value) {
-        bytes[start] = (byte) ((value >>> 24) & 0xFF);
-        bytes[start + 1] = (byte) ((value >>> 16) & 0xFF);
+        bytes[start] = (byte) ((value >>> 8) & 0xFF);
+        bytes[start + 1] = (byte) ((value >>> 0) & 0xFF);
     }

Original issue reported on code.google.com by ecarm...@ucr.edu on 7 Jul 2012 at 4:02

GoogleCodeExporter commented 9 years ago
Yup, that's obviously a bug :)
Thanks for reporting

Original comment by alexande...@gmail.com on 7 Jul 2012 at 5:46

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1659.

Original comment by alexande...@gmail.com on 7 Jul 2012 at 5:55