mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8323552: AbstractMemorySegmentImpl#mismatch returns -1 when comparing distinct areas of the same instance of MemorySegment
Reviewed-by: mcimadamore
This commit is contained in:
parent
b235682a18
commit
93579c29e3
2 changed files with 30 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -681,10 +681,6 @@ public abstract sealed class AbstractMemorySegmentImpl
|
|||
long dstBytes = dstToOffset - dstFromOffset;
|
||||
srcImpl.checkAccess(srcFromOffset, srcBytes, true);
|
||||
dstImpl.checkAccess(dstFromOffset, dstBytes, true);
|
||||
if (dstImpl == srcImpl) {
|
||||
srcImpl.checkValidState();
|
||||
return -1;
|
||||
}
|
||||
|
||||
long bytes = Math.min(srcBytes, dstBytes);
|
||||
long i = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue