summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-07-18 16:17:23 +1000
committerDamien George <damien.p.george@gmail.com>2017-07-18 16:17:23 +1000
commit016325dd0a5ad0904378004e728ccca19ee2b30d (patch)
treee0486b574a08cebc74fb9f66d54f042222a92257 /py
parent299bc625864b9e624ed599c94a5f95870516139a (diff)
py/vm: Make n_state variable local to just set-up part of VM.
It's not used anywhere else in the VM loop, and clashes with (is shadowed by) the n_state variable that's redeclared towards the end of the mp_execute_bytecode function. Code size is unchanged.
Diffstat (limited to 'py')
-rw-r--r--py/vm.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/py/vm.c b/py/vm.c
index 7451d53b9..bb120e775 100644
--- a/py/vm.c
+++ b/py/vm.c
@@ -162,9 +162,13 @@ mp_vm_return_kind_t mp_execute_bytecode(mp_code_state_t *code_state, volatile mp
run_code_state: ;
#endif
// Pointers which are constant for particular invocation of mp_execute_bytecode()
- size_t n_state = mp_decode_uint_value(code_state->fun_bc->bytecode);
- mp_obj_t * /*const*/ fastn = &code_state->state[n_state - 1];
- mp_exc_stack_t * /*const*/ exc_stack = (mp_exc_stack_t*)(code_state->state + n_state);
+ mp_obj_t * /*const*/ fastn;
+ mp_exc_stack_t * /*const*/ exc_stack;
+ {
+ size_t n_state = mp_decode_uint_value(code_state->fun_bc->bytecode);
+ fastn = &code_state->state[n_state - 1];
+ exc_stack = (mp_exc_stack_t*)(code_state->state + n_state);
+ }
// variables that are visible to the exception handler (declared volatile)
volatile bool currently_in_except_block = MP_TAGPTR_TAG0(code_state->exc_sp); // 0 or 1, to detect nested exceptions