py/emitnative: Add support for using setjmp with native emitter.

To enable this feature the N_NLR_SETJMP macro should be set to 1 before
including py/emitnative.c.
This commit is contained in:
Damien George
2019-09-10 13:44:22 +10:00
parent 4107597b84
commit 3504edc804
3 changed files with 24 additions and 0 deletions

View File

@@ -244,7 +244,11 @@ const void *const mp_fun_table[MP_F_NUMBER_OF] = {
mp_call_method_n_kw_var,
mp_native_getiter,
mp_native_iternext,
#if MICROPY_NLR_SETJMP
nlr_push_tail,
#else
nlr_push,
#endif
nlr_pop,
mp_native_raise,
mp_import_name,
@@ -262,6 +266,11 @@ const void *const mp_fun_table[MP_F_NUMBER_OF] = {
mp_small_int_floor_divide,
mp_small_int_modulo,
mp_native_yield_from,
#if MICROPY_NLR_SETJMP
setjmp,
#else
NULL,
#endif
};
#endif // MICROPY_EMIT_NATIVE