@@ -488,6 +488,7 @@ iseq_load(VALUE self, VALUE data, VALUE parent, VALUE opt)
488488 rb_iseq_t * iseq ;
489489 rb_compile_option_t option ;
490490 int i = 0 ;
491+ int local_size ;
491492
492493 /* [magic, major_version, minor_version, format_type, misc,
493494 * label, path, first_lineno,
@@ -511,6 +512,7 @@ iseq_load(VALUE self, VALUE data, VALUE parent, VALUE opt)
511512
512513 type = CHECK_SYMBOL (rb_ary_entry (data , i ++ ));
513514 locals = CHECK_ARRAY (rb_ary_entry (data , i ++ ));
515+ local_size = NUM2INT (rb_hash_aref (misc , ID2SYM (rb_intern ("local_size" ))));
514516
515517 args = rb_ary_entry (data , i ++ );
516518 if (FIXNUM_P (args ) || (args = CHECK_ARRAY (args ))) {
@@ -561,7 +563,7 @@ iseq_load(VALUE self, VALUE data, VALUE parent, VALUE opt)
561563 prepare_iseq_build (iseq , name , path , absolute_path , first_lineno ,
562564 parent , (enum iseq_type )iseq_type , 0 , & option );
563565
564- rb_iseq_build_from_ary (iseq , locals , args , exception , body );
566+ rb_iseq_build_from_ary (iseq , local_size , locals , args , exception , body );
565567
566568 cleanup_iseq_build (iseq );
567569 return iseqval ;
0 commit comments