Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
66327006
Commit
66327006
authored
Jan 02, 2014
by
Damien George
Browse files
py: change negative array indices with array - 1.
parent
27bf5b82
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/vm.c
View file @
66327006
...
...
@@ -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
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment