diff options
author | Alessandro Gatti <a.gatti@frob.it> | 2025-01-25 09:50:20 +0100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2025-05-29 12:12:39 +1000 |
commit | eccd23feb6ba32abca2a26978501a53ff4e25fe0 (patch) | |
tree | b72db3bc43d226b0daa02292644943d55ea24c67 /py/stackctrl.h | |
parent | 5cfafb73dacb6df7ab9e8dc374e6f8a75a3fae77 (diff) |
py/asmxtensa: Replace printf messages with exceptions.
This commit removes old raw printf calls happening inside certain branch
opcode emitters, indicating the target label is out of range for the
opcode. They have been replaced with a RuntimeError being raised in
these cases, using a parameterised qstr instead.
Whilst this technically breaks runtime behaviour expectations, the
generated code would not have worked anyway so it's better to catch
those cases early. This should be updated to always emit long jumps
unless jumps are backwards and short enough, following the other ports,
but that's something coming later.
This is actually needed because there are test files that do not work
when processed through mpy-cross and entirely converted to native code.
The original implementation would still generate mostly-valid code that
was bound to crash on the device, whilst this change would prevent
invalid code to even be emitted in the first place.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
Diffstat (limited to 'py/stackctrl.h')
0 files changed, 0 insertions, 0 deletions