[lworld] RFR: 8377576: [lworld] JVM_CopyOfSpecialArray does not handle all inputs correctly

Paul Hübner phubner at openjdk.org
Wed Feb 18 08:55:37 UTC 2026


On Mon, 16 Feb 2026 15:38:40 GMT, Paul Hübner <phubner at openjdk.org> wrote:

> Hi all,
> 
> `Arrays.copyOf` and `Arrays.copyOfRange` internally use the same function, `JVM_CopyOfSpecialArray`. While they both copy arrays, there are some semantic differences in parameter checking and exception throwing between the two that `JVM_CopyOfSpecialArray` is unable to differentiate. This patch includes:
> * Separate error condition checking and exception throwing per method.
> * New test cases for each method.
> 
> Testing: tier 1.

Thanks for the review Chen!

-------------

PR Comment: https://git.openjdk.org/valhalla/pull/2115#issuecomment-3919495630


More information about the valhalla-dev mailing list