QUERY · ISSUE
mpy-cross: Assertion failed when compiling tests/basics/exception_chain.py.
bug
Port, board and/or hardware
Unix on Linux/amd64
MicroPython version
MicroPython v1.26.0-preview.261.gbcc8d4ee1.dirty on 2025-06-22; linux [GCC 15.1.1] version
Reproduction
- Build mpy-cross with no special flags (
make -C mpy-cross clean && make -C mpy-cross) - Compile
tests/basics/exception_chain.pyinto native code (arch does not matter) withmpy-cross -X emit=native -march=debug tests/basics/exception_chain.py mpy-crosswill crash.
Expected behaviour
Compiling tests/basics/exception_chain.py should not crash mpy-cross.
Observed behaviour
mpy-cross crashes with:
mpy-cross: ../py/emitnative.c:2947: emit_native_raise_varargs: Assertion `n_args == 1' failed.`
Additional Information
If having a multi-arg exception is not supported for native code compilation, then an error message should be printed rather than crashing the compiler.
Code of Conduct
Yes, I agree
CANDIDATE · ISSUE
Assertion error on invalid string to compile()
bug
Port, board and/or hardware
unix port, coverage variant, x86_64 linux
MicroPython version
MicroPython v1.26.0-preview.521.g658a2e3dbd on 2025-08-02; linux [GCC 12.2.0] version
Reproduction
>>> compile("a\\\n", "", "eval")
micropython: ../../py/emitbc.c:356: mp_emit_bc_end_pass: Assertion `emit->stack_size == 0' failed.
Expected behaviour
Should throw a SyntaxError
Observed behaviour
crashes with an assertion failure
Additional Information
This crash was found by aflplusplus and minimized manually.
Code of Conduct
Yes, I agree