Skip to content

Commit 30b42dd

Browse files
committed
py: Remove unused "use_stack" argument from for_iter_end emit function.
1 parent 088740e commit 30b42dd

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

py/compile.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,7 +1484,7 @@ STATIC void compile_for_stmt(compiler_t *comp, mp_parse_node_struct_t *pns) {
14841484
EMIT_ARG(jump, continue_label);
14851485
}
14861486
EMIT_ARG(label_assign, pop_label);
1487-
EMIT_ARG(for_iter_end, true);
1487+
EMIT(for_iter_end);
14881488

14891489
// break/continue apply to outer loop (if any) in the else block
14901490
END_BREAK_CONTINUE_BLOCK
@@ -2906,7 +2906,7 @@ STATIC void compile_scope_comp_iter(compiler_t *comp, mp_parse_node_struct_t *pn
29062906

29072907
EMIT_ARG(jump, l_top);
29082908
EMIT_ARG(label_assign, l_end);
2909-
EMIT_ARG(for_iter_end, true);
2909+
EMIT(for_iter_end);
29102910
}
29112911

29122912
STATIC void check_for_doc_string(compiler_t *comp, mp_parse_node_t pn) {

py/emit.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ typedef struct _emit_method_table_t {
112112
void (*end_finally)(emit_t *emit);
113113
void (*get_iter)(emit_t *emit, bool use_stack);
114114
void (*for_iter)(emit_t *emit, mp_uint_t label);
115-
void (*for_iter_end)(emit_t *emit, bool use_stack);
115+
void (*for_iter_end)(emit_t *emit);
116116
void (*pop_block)(emit_t *emit);
117117
void (*pop_except)(emit_t *emit);
118118
void (*unary_op)(emit_t *emit, mp_unary_op_t op);
@@ -230,7 +230,7 @@ void mp_emit_bc_setup_finally(emit_t *emit, mp_uint_t label);
230230
void mp_emit_bc_end_finally(emit_t *emit);
231231
void mp_emit_bc_get_iter(emit_t *emit, bool use_stack);
232232
void mp_emit_bc_for_iter(emit_t *emit, mp_uint_t label);
233-
void mp_emit_bc_for_iter_end(emit_t *emit, bool use_stack);
233+
void mp_emit_bc_for_iter_end(emit_t *emit);
234234
void mp_emit_bc_pop_block(emit_t *emit);
235235
void mp_emit_bc_pop_except(emit_t *emit);
236236
void mp_emit_bc_unary_op(emit_t *emit, mp_unary_op_t op);

py/emitbc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -787,8 +787,8 @@ void mp_emit_bc_for_iter(emit_t *emit, mp_uint_t label) {
787787
emit_write_bytecode_byte_unsigned_label(emit, MP_BC_FOR_ITER, label);
788788
}
789789

790-
void mp_emit_bc_for_iter_end(emit_t *emit, bool use_stack) {
791-
emit_bc_pre(emit, -(use_stack ? sizeof(mp_obj_iter_buf_t) / sizeof(mp_obj_t) : 1));
790+
void mp_emit_bc_for_iter_end(emit_t *emit) {
791+
emit_bc_pre(emit, -(sizeof(mp_obj_iter_buf_t) / sizeof(mp_obj_t)));
792792
}
793793

794794
void mp_emit_bc_pop_block(emit_t *emit) {

py/emitnative.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1827,10 +1827,10 @@ STATIC void emit_native_for_iter(emit_t *emit, mp_uint_t label) {
18271827
emit_post_push_reg(emit, VTYPE_PYOBJ, REG_RET);
18281828
}
18291829

1830-
STATIC void emit_native_for_iter_end(emit_t *emit, bool use_stack) {
1830+
STATIC void emit_native_for_iter_end(emit_t *emit) {
18311831
// adjust stack counter (we get here from for_iter ending, which popped the value for us)
18321832
emit_native_pre(emit);
1833-
adjust_stack(emit, -(use_stack ? sizeof(mp_obj_iter_buf_t) / sizeof(mp_obj_t) : 1));
1833+
adjust_stack(emit, -(sizeof(mp_obj_iter_buf_t) / sizeof(mp_obj_t)));
18341834
emit_post(emit);
18351835
}
18361836

0 commit comments

Comments
 (0)