diff options
author | Damien George <damien.p.george@gmail.com> | 2019-09-10 13:44:22 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-10-05 13:41:58 +1000 |
commit | 3504edc8048f8ab038ace50b0bbdf65b30619cc5 (patch) | |
tree | 81f29a430d623e178ef4f29f9be4bbc592d764d8 /py/nativeglue.c | |
parent | 4107597b845c04b7184215b3202d596998141cb9 (diff) | |
download | micropython-3504edc8048f8ab038ace50b0bbdf65b30619cc5.tar.gz micropython-3504edc8048f8ab038ace50b0bbdf65b30619cc5.zip |
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.
Diffstat (limited to 'py/nativeglue.c')
-rw-r--r-- | py/nativeglue.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/py/nativeglue.c b/py/nativeglue.c index 62b76eb6b1..4405b2d116 100644 --- a/py/nativeglue.c +++ b/py/nativeglue.c @@ -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 |