summaryrefslogtreecommitdiffstatshomepage
path: root/py/emitbc.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-11-02 21:55:42 +0000
committerDamien George <damien.p.george@gmail.com>2015-11-13 12:49:18 +0000
commitd8c834c95d506db979ec871417de90b7951edc30 (patch)
tree929cb08dde61d960d18f47bd80f56114ff10bb4f /py/emitbc.c
parentc8e9c0d89afa90694790fd48e1bf527487a5beb7 (diff)
downloadmicropython-d8c834c95d506db979ec871417de90b7951edc30.tar.gz
micropython-d8c834c95d506db979ec871417de90b7951edc30.zip
py: Add MICROPY_PERSISTENT_CODE_LOAD/SAVE to load/save bytecode.
MICROPY_PERSISTENT_CODE must be enabled, and then enabling MICROPY_PERSISTENT_CODE_LOAD/SAVE (either or both) will allow loading and/or saving of code (at the moment just bytecode) from/to a .mpy file.
Diffstat (limited to 'py/emitbc.c')
-rw-r--r--py/emitbc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/py/emitbc.c b/py/emitbc.c
index 4cc0ca646a..062a7ea233 100644
--- a/py/emitbc.c
+++ b/py/emitbc.c
@@ -436,7 +436,11 @@ void mp_emit_bc_end_pass(emit_t *emit) {
} else if (emit->pass == MP_PASS_EMIT) {
mp_emit_glue_assign_bytecode(emit->scope->raw_code, emit->code_base,
emit->code_info_size + emit->bytecode_size,
- emit->const_table, emit->scope->scope_flags);
+ emit->const_table,
+ #if MICROPY_PERSISTENT_CODE_SAVE
+ emit->ct_cur_obj, emit->ct_cur_raw_code,
+ #endif
+ emit->scope->scope_flags);
}
}