summaryrefslogtreecommitdiff
path: root/py/compile.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-05-31 17:59:11 +0100
committerDamien George <damien.p.george@gmail.com>2014-05-31 17:59:11 +0100
commit5b5562c1d13fa0b78fd13731cebdaa911eb47726 (patch)
tree3b5b698e0c48b49cd1e896fc8dee262b952f9296 /py/compile.c
parent049a01d148c757a17e9804a2b1e42c918e29b094 (diff)
py: Fix stack underflow with optimised for loop.
Diffstat (limited to 'py/compile.c')
-rw-r--r--py/compile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/compile.c b/py/compile.c
index c90772a7e..1f0d90570 100644
--- a/py/compile.c
+++ b/py/compile.c
@@ -1745,7 +1745,7 @@ void compile_while_stmt(compiler_t *comp, mp_parse_node_struct_t *pns) {
// And, if the loop never runs, the loop variable should never be assigned
void compile_for_stmt_optimised_range(compiler_t *comp, mp_parse_node_t pn_var, mp_parse_node_t pn_start, mp_parse_node_t pn_end, mp_parse_node_t pn_step, mp_parse_node_t pn_body, mp_parse_node_t pn_else) {
START_BREAK_CONTINUE_BLOCK
- comp->break_label |= MP_EMIT_BREAK_FROM_FOR;
+ // note that we don't need to pop anything when breaking from an optimise for loop
uint top_label = comp_next_label(comp);
uint entry_label = comp_next_label(comp);