Fix ArrayList.GetRange().GetRange().ToArray() (#43223)
authorStephen Toub <stoub@microsoft.com>
Tue, 13 Oct 2020 13:18:30 +0000 (09:18 -0400)
committerGitHub <noreply@github.com>
Tue, 13 Oct 2020 13:18:30 +0000 (09:18 -0400)
commitf0cafdc640f405de4915245e7e24e632c64e77fc
tree768b3644343c7dbd5e34e9013143fb18d07082c3
parentaef523bea727909447d4a7d7567d3f7fb3c0754f
Fix ArrayList.GetRange().GetRange().ToArray() (#43223)

The range created by the second GetRange call has an empty _items array that should be ignored, but ToArray on it was trying to copy from that _items directly rather than going through the source's CopyTo method.
src/libraries/System.Collections.NonGeneric/tests/ArrayListTests.cs
src/libraries/System.Private.CoreLib/src/System/Collections/ArrayList.cs