File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ def disassemble(co, lasti):
4040 print '(' + co .co_names [oparg ] + ')' ,
4141 elif op in hasjrel :
4242 print '(to ' + `i + oparg` + ')' ,
43+ elif op in haslocal :
44+ print '(' + co .co_varnames [oparg ] + ')' ,
4345 print
4446
4547def findlabels (code ):
@@ -67,6 +69,7 @@ def findlabels(code):
6769hasname = []
6870hasjrel = []
6971hasjabs = []
72+ haslocal = []
7073
7174opname = ['' ] * 256
7275for op in range (256 ): opname [op ] = '<' + `op` + '>'
@@ -183,8 +186,11 @@ def jabs_op(name, op):
183186def_op ('RESERVE_FAST' , 123 ) # Number of local variables
184187hasconst .append (123 )
185188def_op ('LOAD_FAST' , 124 ) # Local variable number
189+ haslocal .append (124 )
186190def_op ('STORE_FAST' , 125 ) # Local variable number
191+ haslocal .append (125 )
187192def_op ('DELETE_FAST' , 126 ) # Local variable number
193+ haslocal .append (126 )
188194
189195def_op ('SET_LINENO' , 127 ) # Current line number
190196SET_LINENO = 127
You can’t perform that action at this time.
0 commit comments