IronLanguages / ironpython2

Implementation of the Python programming language for .NET Framework; built on top of the Dynamic Language Runtime (DLR).

Home Page:http://ironpython.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

indexing zero-length lists

thautwarm opened this issue · comments

.NET 6 throws ArgumentOutOfRangeException when executing the following code:

newData = new List<T>(icnt);
for (int i = start; i > stop; i += step) {
newData[index++] = l[i];

It seems that such code is not used in IronPython 2. I found this bug when reusing the code for a Unity IL2CPP compatible .NET Python implementation.

It seems that such code is not used in IronPython 2. I found this bug when reusing the code for a Unity IL2CPP compatible .NET Python implementation.

Indeed, looks like extended slicing doesn't work with List<T> and this code is never invoked.

Doesn't appear to be an issue with IronPython 3 (the code has changed since it split from ironpython2).