Bug 1537 - ByteBuffer should use unsigned comparison with bound
Summary: ByteBuffer should use unsigned comparison with bound
Status: RESOLVED FIXED
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P1 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
: 3388 (view as bug list)
Depends on: 3388
Blocks: 2127 2231 3119
  Show dependency treegraph
 
Reported: 2005-10-24 21:32 UTC by Jeff Johnston
Modified: 2007-07-23 09:48 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Johnston 2005-10-24 21:32:49 UTC
The ByteBuffer get methods use a java comparison between the offset and the
upper bound.  This is a signed comparison and doesn't work if we have mapped the
ByteBuffer onto a 64-bit memory space like on AMD64.  A special unsigned
comparison routine is required.  In Java, this could be:

boolean uLongLessThan (a, b)
{
   if (a >=0 && b >= 0 || a < 0 && b < 0)
        return a < b;
   else
        return b < 0;
}

Alternatively, the comparison could be pushed down to cni code and done in C
where unsigned comparisons can be made.
Comment 1 Yao Qi 2006-10-31 03:36:55 UTC
Hi, Tim,
Since you are working on this issue, I add you in the cc list.

Any help on ppc64 side, let me know.  Thanks!
Comment 2 Tim Moore 2006-11-28 17:47:54 UTC
Fixed with inua/eio/ByteBuffer.java 1.4
Comment 3 Mark Wielaard 2007-07-23 09:48:01 UTC
*** Bug 3388 has been marked as a duplicate of this bug. ***