File tree Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,9 @@ extern "C" {
5454 (opcode) == RAISE_VARARGS || \
5555 (opcode) == RERAISE)
5656
57+ #define IS_RETURN_OPCODE (opcode ) \
58+ (opcode == RETURN_VALUE)
59+
5760
5861/* Flags used in the oparg for MAKE_FUNCTION */
5962#define MAKE_FUNCTION_DEFAULTS 0x01
Original file line number Diff line number Diff line change @@ -1715,7 +1715,7 @@ _PyCode_ReturnsValue(PyCodeObject *co)
17151715 Py_ssize_t len = Py_SIZE (co );
17161716 for (int i = 0 ; i < len ; i ++ ) {
17171717 _Py_CODEUNIT inst = _Py_GetBaseCodeUnit (co , i );
1718- if (inst .op .code == RETURN_VALUE ) {
1718+ if (IS_RETURN_OPCODE ( inst .op .code ) ) {
17191719 assert (i != 0 );
17201720 // Ignore it if it returns None.
17211721 _Py_CODEUNIT prev = _Py_GetBaseCodeUnit (co , i - 1 );
Original file line number Diff line number Diff line change @@ -295,7 +295,7 @@ dump_instr(cfg_instr *i)
295295static inline int
296296basicblock_returns (const basicblock * b ) {
297297 cfg_instr * last = basicblock_last_instr (b );
298- return last && last -> i_opcode == RETURN_VALUE ;
298+ return last && IS_RETURN_OPCODE ( last -> i_opcode ) ;
299299}
300300
301301static void
You can’t perform that action at this time.
0 commit comments