summaryrefslogtreecommitdiff
path: root/py/emitbc.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/emitbc.c')
-rw-r--r--py/emitbc.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/py/emitbc.c b/py/emitbc.c
index a07657408..ca5f07085 100644
--- a/py/emitbc.c
+++ b/py/emitbc.c
@@ -393,13 +393,18 @@ bool mp_emit_bc_end_pass(emit_t *emit) {
mp_raise_msg(&mp_type_RuntimeError, MP_ERROR_TEXT("bytecode overflow"));
}
+ #if MICROPY_PERSISTENT_CODE_SAVE || MICROPY_DEBUG_PRINTERS
+ size_t bytecode_len = emit->code_info_size + emit->bytecode_size;
+ #if MICROPY_DEBUG_PRINTERS
+ emit->scope->raw_code_data_len = bytecode_len;
+ #endif
+ #endif
+
// Bytecode is finalised, assign it to the raw code object.
mp_emit_glue_assign_bytecode(emit->scope->raw_code, emit->code_base,
- #if MICROPY_PERSISTENT_CODE_SAVE || MICROPY_DEBUG_PRINTERS
- emit->code_info_size + emit->bytecode_size,
- #endif
emit->emit_common->children,
#if MICROPY_PERSISTENT_CODE_SAVE
+ bytecode_len,
emit->emit_common->ct_cur_child,
#endif
emit->scope->scope_flags);