diff options
author | Takashi Kokubun <[email protected]> | 2019-11-09 21:40:38 -0800 |
---|---|---|
committer | Takashi Kokubun <[email protected]> | 2019-11-09 21:40:38 -0800 |
commit | 5c168c7e7f73d400db45980115dedab4deefcda7 (patch) | |
tree | 9e6ae3df84029eff369e3f83f307124db3d3ed81 /iseq.c | |
parent | 0483d01f6bdd3d16b31244a7aaadb4c31f6ecee7 (diff) |
Support RB_BUILTIN in ISeq#to_a
Diffstat (limited to 'iseq.c')
-rw-r--r-- | iseq.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -2802,6 +2802,21 @@ iseq_data_to_ary(const rb_iseq_t *iseq) rb_ary_push(ary, val); } break; + case TS_BUILTIN: + { + VALUE val = rb_hash_new(); +#if SIZEOF_VALUE <= SIZEOF_LONG + VALUE func_ptr = LONG2NUM((SIGNED_VALUE)((RB_BUILTIN)*seq)->func_ptr); +#else + VALUE func_ptr = LL2NUM((SIGNED_VALUE)((RB_BUILTIN)*seq)->func_ptr); +#endif + rb_hash_aset(val, ID2SYM(rb_intern("func_ptr")), func_ptr); + rb_hash_aset(val, ID2SYM(rb_intern("argc")), INT2NUM(((RB_BUILTIN)*seq)->argc)); + rb_hash_aset(val, ID2SYM(rb_intern("index")), INT2NUM(((RB_BUILTIN)*seq)->index)); + rb_hash_aset(val, ID2SYM(rb_intern("name")), rb_str_new_cstr(((RB_BUILTIN)*seq)->name)); + rb_ary_push(ary, val); + } + break; default: rb_bug("unknown operand: %c", insn_op_type(insn, j)); } |