diff options
author | Damien George <damien.p.george@gmail.com> | 2014-01-02 18:20:41 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-01-02 18:20:41 +0000 |
commit | 66327006fc723af5ca66baf325a251e5944dddbb (patch) | |
tree | 7b7c0a92bcd45be413f03ff3cd5407c58dec0e53 /py | |
parent | 27bf5b829b799e203b937fb2689f7e89d0659854 (diff) |
py: change negative array indices with array - 1.
Diffstat (limited to 'py')
-rw-r--r-- | py/vm.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -78,7 +78,7 @@ bool mp_execute_byte_code_2(const byte **ip_in_out, mp_obj_t *fastn, mp_obj_t ** volatile machine_uint_t currently_in_except_block = 0; // 0 or 1, to detect nested exceptions machine_uint_t exc_stack[8]; // on the exception stack we store (ip, sp | X) for each block, X = previous value of currently_in_except_block - machine_uint_t *volatile exc_sp = &exc_stack[-1]; // stack grows up, exc_sp points to top of stack + machine_uint_t *volatile exc_sp = &exc_stack[0] - 1; // stack grows up, exc_sp points to top of stack // outer exception handling loop for (;;) { @@ -453,7 +453,7 @@ bool mp_execute_byte_code_2(const byte **ip_in_out, mp_obj_t *fastn, mp_obj_t ** case MP_BC_RETURN_VALUE: nlr_pop(); *sp_in_out = sp; - assert(exc_sp == &exc_stack[-1]); + assert(exc_sp == &exc_stack[0] - 1); return false; case MP_BC_YIELD_VALUE: |