refactor(core): use setjmp instead of native x64 impl
What changed, and why it matters
This commit changes a build configuration for Trezor's Unix emulator so that MicroPython uses the standard C setjmp/longjmp mechanism for non-local returns instead of a custom x86_64 assembly implementation. There is no direct security fix here; it is a portability/refactoring change. It does not affect the actual Trezor hardware firmware.
No security action required. Treat as a normal refactoring commit. If auditing, verify that the setjmp-based NLR behaves correctly in the emulator test environment, but this is not a security-relevant change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The single-line change adds #define MICROPY_NLR_SETJMP (1) in core/embed/projects/unix/mpconfigport.h. This tells MicroPython to use the portable setjmp-based non-local return (NLR) implementation rather than the native x86_64 assembly NLR implementation. This is a build-time configuration change for the Unix port only and is not a vulnerability patch.
Changed components
core/embed/projects/unix/mpconfigport.hTrezor Unix emulator build configurationInspect captured patch +1 / −0
diff --git a/core/embed/projects/unix/mpconfigport.h b/core/embed/projects/unix/mpconfigport.h
index 03b26833..cdca8864 100644
--- a/core/embed/projects/unix/mpconfigport.h
+++ b/core/embed/projects/unix/mpconfigport.h
@@ -58,6 +58,7 @@
#define MICROPY_COMP_RETURN_IF_EXPR (1)
#define MICROPY_HELPER_LEXER_UNIX (1)
#define MICROPY_READER_POSIX (1)
+#define MICROPY_NLR_SETJMP (1)
// optimisations
#define MICROPY_OPT_COMPUTED_GOTO (1)
Why this scored 12/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.