@@ -235,6 +235,9 @@ def to_a
235
235
end
236
236
end
237
237
238
+ dumped_options = argument_options . dup
239
+ dumped_options [ :opt ] . map! ( &:name ) if dumped_options [ :opt ]
240
+
238
241
# Next, return the instruction sequence as an array.
239
242
[
240
243
MAGIC ,
@@ -252,7 +255,7 @@ def to_a
252
255
location . start_line ,
253
256
type ,
254
257
local_table . names ,
255
- argument_options ,
258
+ dumped_options ,
256
259
[ ] ,
257
260
dumped
258
261
]
@@ -308,10 +311,6 @@ def push(insn)
308
311
end
309
312
end
310
313
311
- def label_at_index
312
- push ( :"label_#{ length } " )
313
- end
314
-
315
314
def event ( name )
316
315
push ( name )
317
316
end
@@ -767,6 +766,11 @@ def toregexp(options, length)
767
766
def self . from ( source , options = Compiler ::Options . new , parent_iseq = nil )
768
767
iseq = new ( source [ 9 ] , source [ 5 ] , parent_iseq , Location . default , options )
769
768
769
+ # set up the labels object so that the labels are shared between the
770
+ # location in the instruction sequence and the instructions that
771
+ # reference them
772
+ labels = Hash . new { |hash , name | hash [ name ] = Label . new ( name ) }
773
+
770
774
# set up the correct argument size
771
775
iseq . argument_size = source [ 4 ] [ :arg_size ]
772
776
@@ -775,11 +779,9 @@ def self.from(source, options = Compiler::Options.new, parent_iseq = nil)
775
779
776
780
# set up the argument options
777
781
iseq . argument_options . merge! ( source [ 11 ] )
778
-
779
- # set up the labels object so that the labels are shared between the
780
- # location in the instruction sequence and the instructions that
781
- # reference them
782
- labels = Hash . new { |hash , name | hash [ name ] = Label . new ( name ) }
782
+ if iseq . argument_options [ :opt ]
783
+ iseq . argument_options [ :opt ] . map! { |opt | labels [ opt ] }
784
+ end
783
785
784
786
# set up all of the instructions
785
787
source [ 13 ] . each do |insn |
0 commit comments