summaryrefslogtreecommitdiffstatshomepage
path: root/py/compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/compile.c')
-rw-r--r--py/compile.c5
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];