diff options
author | Damien George <damien.p.george@gmail.com> | 2016-04-07 08:50:38 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-04-07 08:50:38 +0100 |
commit | ce8b4e87494a11f389de7629e82043d6fb70284e (patch) | |
tree | d448f6ed10e8897f23ab52a09aa3805f550eab7f /py/emitbc.c | |
parent | 2c407bcf2007b1c899bbee45b1a139c27a2dc47b (diff) |
py: Combine continuous block of emit steps into with_cleanup emit call.
Because different emitters need to handle with-cleanup in different ways.
Diffstat (limited to 'py/emitbc.c')
-rw-r--r-- | py/emitbc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/py/emitbc.c b/py/emitbc.c index 14298bad4..d871aa4ce 100644 --- a/py/emitbc.c +++ b/py/emitbc.c @@ -758,7 +758,10 @@ void mp_emit_bc_setup_with(emit_t *emit, mp_uint_t label) { emit_write_bytecode_byte_unsigned_label(emit, MP_BC_SETUP_WITH, label); } -void mp_emit_bc_with_cleanup(emit_t *emit) { +void mp_emit_bc_with_cleanup(emit_t *emit, mp_uint_t label) { + mp_emit_bc_pop_block(emit); + mp_emit_bc_load_const_tok(emit, MP_TOKEN_KW_NONE); + mp_emit_bc_label_assign(emit, label); emit_bc_pre(emit, -4); emit_write_bytecode_byte(emit, MP_BC_WITH_CLEANUP); } |