Open xiaxinmeng opened 1 year ago
Thanks! Seems to hit an assertion error in debug mode.
This one is interesting, I guess would need to break up our slice evaluation into two steps. CPython introduced C APIs to do this in 3.6.1 (PySlice_Unpack and PySlice_AdjustIndices). I'm guessing to fix this very issue?
Interestingly we can crash the latest CPython with a variation...
class X:
def __index__(self):
b.extend(b"aaa")
return 2
b = bytearray(b"A"*10)
b[::X()] = b"c" * 8
b
See the following code, we slice a bytearray object via subscripting, ironpython crashes. This test works well on CPython 3.9.0.
test.py
Error message:
System info: ironpython3-debug(main branch):IronPython 3.4.0b1 DEBUG (3.4.0.0010)[.NETCoreApp,Version=v6.0 on .NET 6.0.11 (64-bit)] on linux operating system: Ubuntu 18.04.6 LTS