diff options
author | Damien George <damien.p.george@gmail.com> | 2016-04-07 08:53:24 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-04-07 08:53:24 +0100 |
commit | 2c915e1ae61785ab6e33189581fb353ebd40d0ca (patch) | |
tree | 3015355b8f36e3b47c4280bb5301b0b921be6ed3 /py/compile.c | |
parent | ce8b4e87494a11f389de7629e82043d6fb70284e (diff) | |
download | micropython-2c915e1ae61785ab6e33189581fb353ebd40d0ca.tar.gz micropython-2c915e1ae61785ab6e33189581fb353ebd40d0ca.zip |
py: Implement basic with support in native emitter.
Diffstat (limited to 'py/compile.c')
-rw-r--r-- | py/compile.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/py/compile.c b/py/compile.c index aef59fb251..ae91455e0e 100644 --- a/py/compile.c +++ b/py/compile.c @@ -1624,6 +1624,11 @@ STATIC void compile_with_stmt_helper(compiler_t *comp, int n, mp_parse_node_t *n compile_node(comp, body); } else { uint l_end = comp_next_label(comp); + if (MICROPY_EMIT_NATIVE && comp->scope_cur->emit_options != MP_EMIT_OPT_BYTECODE) { + // we need to allocate an extra label for the native emitter + // it will use l_end+1 as an auxiliary label + comp_next_label(comp); + } if (MP_PARSE_NODE_IS_STRUCT_KIND(nodes[0], PN_with_item)) { // this pre-bit is of the form "a as b" mp_parse_node_struct_t *pns = (mp_parse_node_struct_t*)nodes[0]; |