summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
Diffstat (limited to 'py')
-rw-r--r--py/emitnative.c3
-rw-r--r--py/mpconfig.h1
-rw-r--r--py/nativeglue.c2
3 files changed, 5 insertions, 1 deletions
diff --git a/py/emitnative.c b/py/emitnative.c
index f123ecbb58..278cc21e78 100644
--- a/py/emitnative.c
+++ b/py/emitnative.c
@@ -609,8 +609,11 @@ STATIC void emit_native_end_pass(emit_t *emit) {
const_table_alloc += nqstr;
}
emit->const_table = m_new(mp_uint_t, const_table_alloc);
+ #if !MICROPY_DYNAMIC_COMPILER
// Store mp_fun_table pointer just after qstrs
+ // (but in dynamic-compiler mode eliminate dependency on mp_fun_table)
emit->const_table[nqstr] = (mp_uint_t)(uintptr_t)mp_fun_table;
+ #endif
#if MICROPY_PERSISTENT_CODE_SAVE
size_t qstr_link_alloc = emit->qstr_link_cur;
diff --git a/py/mpconfig.h b/py/mpconfig.h
index 219f8de44b..4172e175b2 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -338,6 +338,7 @@
#endif
// Whether the compiler is dynamically configurable (ie at runtime)
+// This will disable the ability to execute native/viper code
#ifndef MICROPY_DYNAMIC_COMPILER
#define MICROPY_DYNAMIC_COMPILER (0)
#endif
diff --git a/py/nativeglue.c b/py/nativeglue.c
index 8f38ecd16e..11d7a283a2 100644
--- a/py/nativeglue.c
+++ b/py/nativeglue.c
@@ -95,7 +95,7 @@ mp_obj_t mp_native_to_obj(mp_uint_t val, mp_uint_t type) {
#endif
-#if MICROPY_EMIT_NATIVE
+#if MICROPY_EMIT_NATIVE && !MICROPY_DYNAMIC_COMPILER
STATIC mp_obj_dict_t *mp_native_swap_globals(mp_obj_dict_t *new_globals) {
if (new_globals == NULL) {