Closed microbit-carlos closed 1 year ago
Based on this it should have been fixed in the MicroPython commit used in this repo?: https://github.com/micropython/micropython/issues/8805#issuecomment-1163834651
Looks related to this:
And manually applying this patch fixes that issue, but then it encounters more:
CC ../py/vm.c
../py/vm.c:730:25: error: array index -3 refers past the last possible element for an array in 64-bit address space containing 64-bit (8-byte) elements (max possible 2305843009213693952 elements) [-Werror,-Warray-bounds]
sp[-MP_OBJ_ITER_BUF_NSLOTS + 1] = MP_OBJ_NULL;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
../py/vm.c:257:13: note: array 'sp' declared here
mp_obj_t *sp = code_state->sp;
^
../py/vm.c:731:25: error: array index -2 refers past the last possible element for an array in 64-bit address space containing 64-bit (8-byte) elements (max possible 2305843009213693952 elements) [-Werror,-Warray-bounds]
sp[-MP_OBJ_ITER_BUF_NSLOTS + 2] = obj;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
../py/vm.c:257:13: note: array 'sp' declared here
mp_obj_t *sp = code_state->sp;
^
../py/vm.c:742:25: error: array index -3 refers past the last possible element for an array in 64-bit address space containing 64-bit (8-byte) elements (max possible 2305843009213693952 elements) [-Werror,-Warray-bounds]
if (sp[-MP_OBJ_ITER_BUF_NSLOTS + 1] == MP_OBJ_NULL) {
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
../py/vm.c:257:13: note: array 'sp' declared here
mp_obj_t *sp = code_state->sp;
^
../py/vm.c:743:31: error: array index -2 refers past the last possible element for an array in 64-bit address space containing 64-bit (8-byte) elements (max possible 2305843009213693952 elements) [-Werror,-Warray-bounds]
obj = sp[-MP_OBJ_ITER_BUF_NSLOTS + 2];
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
../py/vm.c:257:13: note: array 'sp' declared here
mp_obj_t *sp = code_state->sp;
^
4 errors generated.
make: *** [build/py/vm.o] Error 1
Which can then be fixed by applying this patch:
We should update the MicroPython submodule that this repository uses. MicroPython v1.20.0 was released a few weeks ago and I suggest using this version.
Such an update will bring in bug fixes, more Python compatibility (eg bytes.fromhex
and friends) and optimisations. But it shouldn't break any existing micro:bit scripts.
Sounds good 👍
Fixed by 16fe526d88175ab79a21cba8cc449ffea190f8d3 and 5176ffd761ecdcce9836f9a7e1f835710fb9e85c
Thanks Damien! I can confirm I don't have mpy-cross compilation errors with the latest commit.
Haven't had a chance to look at this properly, but I've updated the Xcode toolchain a few weeks ago and I'm guessing a new version of clang might be throwing these error/warnings now.