Skip to content

Commit 4d2ac67

Browse files
committed
Add application example
1 parent 11cf8ec commit 4d2ac67

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Python/flowgraph.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ is_jump(cfg_instr *i)
4848
return OPCODE_HAS_JUMP(i->i_opcode);
4949
}
5050

51+
static inline int
52+
no_exception(cfg_instr *i)
53+
{
54+
return OPCODE_NO_EXCEPTION(i->i_opcode);
55+
}
56+
5157
/* One arg*/
5258
#define INSTR_SET_OP1(I, OP, ARG) \
5359
do { \
@@ -1493,6 +1499,7 @@ optimize_basic_block(PyObject *const_cache, basicblock *bb, PyObject *consts)
14931499
break;
14941500
case STORE_FAST:
14951501
if (opcode == nextop &&
1502+
no_exception(&bb->b_instr[i+1]) &&
14961503
oparg == bb->b_instr[i+1].i_oparg &&
14971504
bb->b_instr[i].i_loc.lineno == bb->b_instr[i+1].i_loc.lineno) {
14981505
bb->b_instr[i].i_opcode = POP_TOP;

0 commit comments

Comments
 (0)