Skip to content
Merged
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
implement Mark's suggestions
  • Loading branch information
iritkatriel committed Nov 30, 2022
commit 857db4e34996231f876add2704669af43bbd5ac0
16 changes: 10 additions & 6 deletions Python/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,20 @@ struct instr {
/* One arg*/
#define INSTR_SET_OP1(I, OP, ARG) \
do { \
struct instr *__instr__ptr__ = (I); \
assert(HAS_ARG(OP) || ((ARG) == 0)); \
(__instr__ptr__)->i_opcode = (OP); \
(__instr__ptr__)->i_oparg = (ARG); \
assert(HAS_ARG(OP)); \
struct instr *_instr__ptr_ = (I); \
_instr__ptr_->i_opcode = (OP); \
_instr__ptr_->i_oparg = (ARG); \
} while (0);

/* No args*/
#define INSTR_SET_OP0(I, OP) \
assert(!HAS_ARG(OP)); \
INSTR_SET_OP1((I), (OP), 0);
do { \
assert(!HAS_ARG(OP)); \
struct instr *_instr__ptr_ = (I); \
_instr__ptr_->i_opcode = (OP); \
_instr__ptr_->i_oparg = 0; \
} while (0);

typedef struct exceptstack {
struct basicblock_ *handlers[CO_MAXBLOCKS+1];
Expand Down