Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uPython-mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TASTE
uPython-mirror
Commits
2bce0bd7
PL1
Commit
2bce0bd7
authored
10 years ago
by
Damien George
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of github.com:micropython/micropython
parents
0aa5d51c
40d6d29a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
py/vm.c
+7
-4
7 additions, 4 deletions
py/vm.c
with
7 additions
and
4 deletions
py/vm.c
+
7
−
4
View file @
2bce0bd7
...
...
@@ -391,6 +391,10 @@ dispatch_loop:
break
;
case
MP_BC_WITH_CLEANUP
:
{
// Arriving here, there's "exception control block" on top of stack,
// and __exit__ bound method underneath it. Bytecode calls __exit__,
// and "deletes" it off stack, shifting "exception control block"
// to its place.
static
const
mp_obj_t
no_exc
[]
=
{
mp_const_none
,
mp_const_none
,
mp_const_none
};
if
(
TOP
()
==
mp_const_none
)
{
sp
--
;
...
...
@@ -432,8 +436,8 @@ dispatch_loop:
//PUSH(MP_OBJ_NEW_SMALL_INT(UNWIND_SILENCED));
// But what we need to do is - pop exception from value stack...
sp
-=
3
;
// ... pop with exception handler, and signal END_FINALLY
// to just execute finally handler normally (
signalled by
None
// ... pop
"
with
"
exception handler, and signal END_FINALLY
// to just execute finally handler normally (
by pushing
None
// on value stack)
assert
(
exc_sp
>=
exc_stack
);
assert
(
exc_sp
->
opcode
==
MP_BC_SETUP_WITH
);
...
...
@@ -709,8 +713,7 @@ yield:
*
exc_sp_in_out
=
MP_TAGPTR_MAKE
(
exc_sp
,
currently_in_except_block
);
return
MP_VM_RETURN_YIELD
;
case
MP_BC_YIELD_FROM
:
{
case
MP_BC_YIELD_FROM
:
{
//#define EXC_MATCH(exc, type) MP_OBJ_IS_TYPE(exc, type)
#define EXC_MATCH(exc, type) mp_obj_exception_match(exc, type)
#define GENERATOR_EXIT_IF_NEEDED(t) if (t != MP_OBJ_NULL && EXC_MATCH(t, &mp_type_GeneratorExit)) { nlr_jump(t); }
...
...
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