зеркало из https://github.com/github/ruby.git
Fix dump of hidden local variable indexes
This fixes test failures when running tests with
RUBY_ISEQ_DUMP_DEBUG=to_binary, which started after
5899f6aa55
was committed.
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
This commit is contained in:
Родитель
532ddc1745
Коммит
6ea01d204e
|
@ -11863,9 +11863,9 @@ ibf_load_id(const struct ibf_load *load, const ID id_index)
|
|||
return 0;
|
||||
}
|
||||
VALUE sym = ibf_load_object(load, id_index);
|
||||
if (rb_type_p(sym, T_FIXNUM)) {
|
||||
if (rb_integer_type_p(sym)) {
|
||||
/* Load hidden local variables as indexes */
|
||||
return FIX2INT(sym);
|
||||
return NUM2ULONG(sym);
|
||||
}
|
||||
return rb_sym2id(sym);
|
||||
}
|
||||
|
@ -12393,7 +12393,7 @@ ibf_dump_local_table(struct ibf_dump *dump, const rb_iseq_t *iseq)
|
|||
VALUE v = ibf_dump_id(dump, body->local_table[i]);
|
||||
if (v == 0) {
|
||||
/* Dump hidden local variables as indexes, so load_from_binary will work with them */
|
||||
v = ibf_dump_object(dump, ULONG2NUM(size-i+1));
|
||||
v = ibf_dump_object(dump, ULONG2NUM(body->local_table[i]));
|
||||
}
|
||||
table[i] = v;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче