Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
02a7c41e
Commit
02a7c41e
authored
Dec 29, 2013
by
Damien
Browse files
Options
Downloads
Patches
Plain Diff
py: implement POP_BLOCK in VM.
parent
319b28a3
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
py/vm.c
+7
-2
7 additions, 2 deletions
py/vm.c
with
7 additions
and
2 deletions
py/vm.c
+
7
−
2
View file @
02a7c41e
...
...
@@ -272,6 +272,7 @@ bool mp_execute_byte_code_2(const byte **ip_in_out, mp_obj_t *fastn, mp_obj_t **
break;
*/
// matched against: POP_BLOCK or POP_EXCEPT (anything else?)
case
MP_BC_SETUP_EXCEPT
:
DECODE_ULABEL
;
// except labels are always forward
*++
exc_sp
=
(
machine_uint_t
)
ip
+
unum
;
...
...
@@ -303,11 +304,15 @@ bool mp_execute_byte_code_2(const byte **ip_in_out, mp_obj_t *fastn, mp_obj_t **
}
break
;
// matched against: SETUP_EXCEPT, SETUP_FINALLY, SETUP_WITH
case
MP_BC_POP_BLOCK
:
// pops block and restores the stack
assert
(
0
);
// we are exiting an exception handler, so pop the last one of the exception-stack
assert
(
exc_sp
>=
&
exc_stack
[
0
]);
currently_in_except_block
=
(
exc_sp
[
0
]
&
1
);
// restore previous state
exc_sp
-=
2
;
// pop back to previous exception handler
break
;
// matched againts: SETUP_EXCEPT
case
MP_BC_POP_EXCEPT
:
// TODO need to work out how blocks work etc
// pops block, checks it's an exception block, and restores the stack, saving the 3 exception values to local threadstate
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment