diff options
Diffstat (limited to 'Python/compile.c')
-rw-r--r-- | Python/compile.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/Python/compile.c b/Python/compile.c index bbd7193..b922e01 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -5551,20 +5551,26 @@ compiler_visit_keyword(struct compiler *c, keyword_ty k) static int compiler_with_except_finish(struct compiler *c, basicblock * cleanup) { UNSET_LOC(c); - basicblock *exit; - exit = compiler_new_block(c); - if (exit == NULL) + basicblock *suppress = compiler_new_block(c); + if (suppress == NULL) { return 0; - ADDOP_JUMP(c, POP_JUMP_IF_TRUE, exit); + } + ADDOP_JUMP(c, POP_JUMP_IF_TRUE, suppress); ADDOP_I(c, RERAISE, 2); - compiler_use_next_block(c, cleanup); - POP_EXCEPT_AND_RERAISE(c); - compiler_use_next_block(c, exit); + compiler_use_next_block(c, suppress); ADDOP(c, POP_TOP); /* exc_value */ ADDOP(c, POP_BLOCK); ADDOP(c, POP_EXCEPT); ADDOP(c, POP_TOP); ADDOP(c, POP_TOP); + basicblock *exit = compiler_new_block(c); + if (exit == NULL) { + return 0; + } + ADDOP_JUMP(c, JUMP, exit); + compiler_use_next_block(c, cleanup); + POP_EXCEPT_AND_RERAISE(c); + compiler_use_next_block(c, exit); return 1; } |