Skip to content

Commit 291806b

Browse files
committed
Fix for Mono
1 parent b6a28dc commit 291806b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Src/IronPython/Runtime/Operations/ArrayOps.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,10 +390,10 @@ private static Array GetSlice(Array data, Slice slice) {
390390
return Array.CreateInstance(data.GetType().GetElementType()!, 0);
391391
}
392392

393-
if (step == 1) {
393+
if (step == 1 && (!ClrModule.IsMono || data.GetLowerBound(0) == 0)) {
394394
int n = stop - start;
395395
Array ret = Array.CreateInstance(data.GetType().GetElementType()!, n);
396-
Array.Copy(data, start, ret, 0, n);
396+
Array.Copy(data, start, ret, 0, n); // doesn't work OK on Mono with non-0-based arrays
397397
return ret;
398398
} else {
399399
int n = PythonOps.GetSliceCount(start, stop, step);

0 commit comments

Comments
 (0)