Create succ_index_table as a part of iseq_setup
With compiling `CPDEBUG >= 2`, `rb_iseq_disasm` segfaults if this table has not been created. Also `ibf_load_iseq_each` calls `rb_iseq_insns_info_encode_positions`.
This commit is contained in:
parent
a9567cc2bf
commit
69b3e0ac59
Notes:
git
2020-04-15 16:07:12 +09:00
@ -1423,6 +1423,13 @@ iseq_setup(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
|
|||||||
debugs("[compile step 6 (update_catch_except_flags)] \n");
|
debugs("[compile step 6 (update_catch_except_flags)] \n");
|
||||||
update_catch_except_flags(iseq->body);
|
update_catch_except_flags(iseq->body);
|
||||||
|
|
||||||
|
#if VM_INSN_INFO_TABLE_IMPL == 2
|
||||||
|
if (iseq->body->insns_info.succ_index_table == NULL) {
|
||||||
|
debugs("[compile step 7 (rb_iseq_insns_info_encode_positions)] \n");
|
||||||
|
rb_iseq_insns_info_encode_positions(iseq);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (compile_debug > 1) {
|
if (compile_debug > 1) {
|
||||||
VALUE str = rb_iseq_disasm(iseq);
|
VALUE str = rb_iseq_disasm(iseq);
|
||||||
printf("%s\n", StringValueCStr(str));
|
printf("%s\n", StringValueCStr(str));
|
||||||
|
8
iseq.c
8
iseq.c
@ -615,6 +615,7 @@ void
|
|||||||
rb_iseq_insns_info_encode_positions(const rb_iseq_t *iseq)
|
rb_iseq_insns_info_encode_positions(const rb_iseq_t *iseq)
|
||||||
{
|
{
|
||||||
#if VM_INSN_INFO_TABLE_IMPL == 2
|
#if VM_INSN_INFO_TABLE_IMPL == 2
|
||||||
|
/* create succ_index_table */
|
||||||
struct rb_iseq_constant_body *const body = iseq->body;
|
struct rb_iseq_constant_body *const body = iseq->body;
|
||||||
int size = body->insns_info.size;
|
int size = body->insns_info.size;
|
||||||
int max_pos = body->iseq_size;
|
int max_pos = body->iseq_size;
|
||||||
@ -657,13 +658,6 @@ finish_iseq_build(rb_iseq_t *iseq)
|
|||||||
ISEQ_COMPILE_DATA_CLEAR(iseq);
|
ISEQ_COMPILE_DATA_CLEAR(iseq);
|
||||||
compile_data_free(data);
|
compile_data_free(data);
|
||||||
|
|
||||||
#if VM_INSN_INFO_TABLE_IMPL == 2 /* succinct bitvector */
|
|
||||||
/* create succ_index_table */
|
|
||||||
if (body->insns_info.succ_index_table == NULL) {
|
|
||||||
rb_iseq_insns_info_encode_positions(iseq);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if VM_CHECK_MODE > 0 && VM_INSN_INFO_TABLE_IMPL > 0
|
#if VM_CHECK_MODE > 0 && VM_INSN_INFO_TABLE_IMPL > 0
|
||||||
validate_get_insn_info(iseq);
|
validate_get_insn_info(iseq);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user