-
Bug
-
Resolution: Fixed
-
P4
-
None
-
Any environment. Bug is in Java code.
-
b16
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8333260 | 22.0.2 | Per-Ake Minborg | P4 | Resolved | Fixed | b09 |
JDK-8333367 | 21.0.5 | Per-Ake Minborg | P4 | Resolved | Fixed | b01 |
Here's the original code fragment:
```
public static long mismatch(MemorySegment srcSegment, long srcFromOffset, long srcToOffset,
MemorySegment dstSegment, long dstFromOffset, long dstToOffset) {
AbstractMemorySegmentImpl srcImpl = (AbstractMemorySegmentImpl)Objects.requireNonNull(srcSegment);
AbstractMemorySegmentImpl dstImpl = (AbstractMemorySegmentImpl)Objects.requireNonNull(dstSegment);
long srcBytes = srcToOffset - srcFromOffset;
long dstBytes = dstToOffset - dstFromOffset;
srcImpl.checkAccess(srcFromOffset, srcBytes, true);
dstImpl.checkAccess(dstFromOffset, dstBytes, true);
if (dstImpl == srcImpl) {
srcImpl.checkValidState();
return -1;
}
...
```
- backported by
-
JDK-8333260 AbstractMemorySegmentImpl#mismatch returns -1 when comparing distinct areas of the same instance of MemorySegment
- Resolved
-
JDK-8333367 AbstractMemorySegmentImpl#mismatch returns -1 when comparing distinct areas of the same instance of MemorySegment
- Resolved
- duplicates
-
JDK-8323524 Incorrect result for MemorySegment::mismatch when comparing different sections of the same segment
- Closed
- relates to
-
JDK-8323524 Incorrect result for MemorySegment::mismatch when comparing different sections of the same segment
- Closed
- links to
-
Commit openjdk/jdk21u-dev/0d9833e5
-
Commit openjdk/jdk22u/91a2e753
-
Commit openjdk/jdk/93579c29
-
Review openjdk/jdk21u-dev/404
-
Review openjdk/jdk22u/131
-
Review openjdk/jdk/17354
-
Review openjdk/jdk/18426