summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
Diffstat (limited to 'py')
-rw-r--r--py/emitnative.c1
-rw-r--r--py/mpconfig.h3
2 files changed, 4 insertions, 0 deletions
diff --git a/py/emitnative.c b/py/emitnative.c
index 211d2895a3..c7cbbf4516 100644
--- a/py/emitnative.c
+++ b/py/emitnative.c
@@ -1174,6 +1174,7 @@ STATIC void emit_native_load_const_str(emit_t *emit, qstr qst, bool bytes) {
STATIC void emit_native_load_const_obj(emit_t *emit, void *obj) {
emit_native_pre(emit);
+ need_reg_single(emit, REG_RET, 0);
ASM_MOV_ALIGNED_IMM_TO_REG(emit->as, (mp_uint_t)obj, REG_RET);
emit_post_push_reg(emit, VTYPE_PYOBJ, REG_RET);
}
diff --git a/py/mpconfig.h b/py/mpconfig.h
index 541f7c75a5..5718ffacbc 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -569,6 +569,9 @@ typedef double mp_float_t;
#define MICROPY_MAKE_POINTER_CALLABLE(p) (p)
#endif
+// If these MP_PLAT_* macros are overridden then the memory allocated by them
+// must be somehow reachable for marking by the GC, since the native code
+// generators store pointers to GC managed memory in the code.
#ifndef MP_PLAT_ALLOC_EXEC
#define MP_PLAT_ALLOC_EXEC(min_size, ptr, size) do { *ptr = m_new(byte, min_size); *size = min_size; } while(0)
#endif