Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove last block duplication
  • Loading branch information
pitrou committed Jul 24, 2017
commit 9c3cfd09ef8639e84faf34d48c0518a2e30c3448
16 changes: 4 additions & 12 deletions Python/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -2670,15 +2670,12 @@ compiler_continue(struct compiler *c)


/* Code generated for "try: <body> finally: <finalbody>" is as follows:
* XXX update this

SETUP_FINALLY F2
SETUP_FINALLY F
<code for body>
POP_BLOCK
F1:
<code for finalbody>
JUMP_ABSOLUTE EXIT
F2:
PUSH_NO_EXCEPT
F:
<code for finalbody>
RERAISE
EXIT:
Expand Down Expand Up @@ -2849,14 +2846,9 @@ compiler_try_except(struct compiler *c, stmt_ty s)
VISIT_SEQ(c, stmt, handler->v.ExceptHandler.body);
ADDOP(c, POP_BLOCK);
ADDOP(c, POP_EXCEPT);
ADDOP(c, PUSH_NO_EXCEPT);
compiler_pop_fblock(c, HANDLER_CLEANUP, cleanup_body);

/* name = None; del name */
ADDOP_O(c, LOAD_CONST, Py_None, consts);
compiler_nameop(c, handler->v.ExceptHandler.name, Store);
compiler_nameop(c, handler->v.ExceptHandler.name, Del);
ADDOP_JREL(c, JUMP_FORWARD, end);

/* finally: */
compiler_use_next_block(c, cleanup_end);
if (!compiler_push_finally_end(c, cleanup_end))
Expand Down