Skip to content

Commit f6db78b

Browse files
committed
fix opcode redefinitions
1 parent 79505b4 commit f6db78b

File tree

1 file changed

+25
-9
lines changed

1 file changed

+25
-9
lines changed

xdis/opcodes/opcode_311.py

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
rm_op(l, "BINARY_MODULO", 22)
4949
rm_op(l, "BINARY_ADD", 23)
5050
rm_op(l, "BINARY_SUBTRACT", 24)
51-
rm_op(l, "BINARY_SUBSCR", 25)
5251
rm_op(l, "BINARY_LSHIFT", 62)
5352
rm_op(l, "BINARY_RSHIFT", 63)
5453
rm_op(l, "BINARY_AND", 64)
@@ -98,6 +97,7 @@
9897
rm_op(l, "MATCH_CLASS", 152)
9998
rm_op(l, "MATCH_KEYS", 33)
10099

100+
101101
# These are added since 3.10...
102102
# OP NAME OPCODE POP PUSH
103103
#---------------------------------------------------------
@@ -126,16 +126,16 @@
126126
jrel_op(l, "POP_JUMP_FORWARD_IF_NOT_NONE", 128, 1, 0)
127127
jrel_op(l, "POP_JUMP_FORWARD_IF_NONE", 129, 1, 0)
128128
# setup with
129-
def_op(l, "BEFORE_WITH", 53, 0, 1)
129+
def_op(l, "BEFORE_WITH", 53, 0, 1)
130130
# match
131-
def_op(l, "MATCH_CLASS", 152, 2, 1)
132-
def_op(l, "MATCH_KEYS", 33, 0, 1)
131+
def_op(l, "MATCH_CLASS", 152, 2, 1)
132+
def_op(l, "MATCH_KEYS", 33, 0, 1)
133133
# generators and co-routines
134-
def_op(l, "ASYNC_GEN_WRAP", 87, 0, 0)
135-
def_op(l, "RETURN_GENERATOR", 75, 0, 0)
136-
def_op(l, "SEND", 123, 0, 0)
134+
def_op(l, "ASYNC_GEN_WRAP", 87, 0, 0)
135+
def_op(l, "RETURN_GENERATOR", 75, 0, 0)
136+
def_op(l, "SEND", 123, 0, 0)
137137
# copy free vars for closures
138-
def_op(l, "COPY_FREE_VARS", 149, 0, 0)
138+
def_op(l, "COPY_FREE_VARS", 149, 0, 0)
139139
# new jump
140140
jrel_op(l, "JUMP_BACKWARD_NO_INTERRUPT", 134, 0, 0)
141141
# new create cells op
@@ -145,7 +145,23 @@
145145
jrel_op(l, "PREP_RERAISE_STAR", 88, 1, 0)
146146
jrel_op(l, "PUSH_EXC_INFO", 35, 0, 1)
147147
# resume, acts like a nop
148-
def_op(l, "RESUME", 151, 0, 0)
148+
def_op(l, "RESUME", 151, 0, 0)
149+
150+
## Redefined OPS
151+
rm_op(l, "STORE_DEREF", 137)
152+
def_op(l, "STORE_DEREF", 138, 1, 0)
153+
154+
rm_op(l, "LOAD_DEREF", 136)
155+
def_op(l, "LOAD_DEREF", 137, 0, 1)
156+
157+
rm_op(l, "DELETE_DEREF", 138)
158+
def_op(l, "DELETE_DEREF", 139, 0, 0)
159+
160+
rm_op(l, "GET_AWAITABLE", 73)
161+
def_op(l, "GET_AWAITABLE", 131, 0, 0)
162+
163+
rm_op(l, "LOAD_CLOSURE", 135)
164+
def_op(l, "LOAD_CLOSURE", 136, 0, 1)
149165

150166
# fmt: on
151167
def format_extended_is_op(arg):

0 commit comments

Comments
 (0)