summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
authorDamien <damien.p.george@gmail.com>2013-11-09 20:12:03 +0000
committerDamien <damien.p.george@gmail.com>2013-11-09 20:12:03 +0000
commitf3822fc34c42370ae1d4dae51e533d4e2069fe86 (patch)
tree4a61cce09583f0f0ea767dccd827bfd477e5dd6c /py
parent6d42ab6625d1c437c7b31a6d357607943c3bdc24 (diff)
downloadmicropython-f3822fc34c42370ae1d4dae51e533d4e2069fe86.tar.gz
micropython-f3822fc34c42370ae1d4dae51e533d4e2069fe86.zip
Fix but with optimised range being 1 over.
Diffstat (limited to 'py')
-rw-r--r--py/compile.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/py/compile.c b/py/compile.c
index ef303c1f46..a01f5f4c58 100644
--- a/py/compile.c
+++ b/py/compile.c
@@ -1378,15 +1378,15 @@ void compile_for_stmt_optimised_range(compiler_t *comp, py_parse_node_t pn_var,
EMIT(jump, continue_label);
EMIT(label_assign, top_label);
+ // compile body
+ compile_node(comp, pn_body);
+
// compile: var += step
c_assign(comp, pn_var, ASSIGN_AUG_LOAD);
compile_node(comp, pn_step);
EMIT(binary_op, RT_BINARY_OP_INPLACE_ADD);
c_assign(comp, pn_var, ASSIGN_AUG_STORE);
- // compile body
- compile_node(comp, pn_body);
-
EMIT(label_assign, continue_label);
// compile: if var < end: goto top