@@ -235,6 +235,9 @@ def to_a
235235 end
236236 end
237237
238+ dumped_options = argument_options . dup
239+ dumped_options [ :opt ] . map! ( &:name ) if dumped_options [ :opt ]
240+
238241 # Next, return the instruction sequence as an array.
239242 [
240243 MAGIC ,
@@ -252,7 +255,7 @@ def to_a
252255 location . start_line ,
253256 type ,
254257 local_table . names ,
255- argument_options ,
258+ dumped_options ,
256259 [ ] ,
257260 dumped
258261 ]
@@ -308,10 +311,6 @@ def push(insn)
308311 end
309312 end
310313
311- def label_at_index
312- push ( :"label_#{ length } " )
313- end
314-
315314 def event ( name )
316315 push ( name )
317316 end
@@ -767,6 +766,11 @@ def toregexp(options, length)
767766 def self . from ( source , options = Compiler ::Options . new , parent_iseq = nil )
768767 iseq = new ( source [ 9 ] , source [ 5 ] , parent_iseq , Location . default , options )
769768
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+
770774 # set up the correct argument size
771775 iseq . argument_size = source [ 4 ] [ :arg_size ]
772776
@@ -775,11 +779,9 @@ def self.from(source, options = Compiler::Options.new, parent_iseq = nil)
775779
776780 # set up the argument options
777781 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
783785
784786 # set up all of the instructions
785787 source [ 13 ] . each do |insn |
0 commit comments