QUERY · ISSUE
Taking slice of memoryview in Viper function crashes PyBoard
bugpy-core
On a PyBoard v1.1 with firmware 1.13, put the following code into a file:
import micropython
@micropython.viper
def take_memoryview_slice():
ba = bytearray(10)
mv = memoryview(ba)
slice = mv[0:1]
Running take_memoryview_slice() resets the PyBoard.
CANDIDATE · PULL REQUEST
py: Fixed case where shifting a memory view right corrupts the contents
py-core
The following snippet (added to the tests) demonstrates the failure:
b = bytearray(b'0123456789')
m = memoryview(b)
m[1:] = m[:-1]
print(m == b'0012345678')
The errant behaviour was observed on a PYBV11 but works fine on the
unix port.
Fixes #6244