summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-04-15 12:57:14 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-04-15 16:06:48 +0900
commit69b3e0ac59f99bbd7e9a76af283f0be1991a3bde (patch)
tree6745fa66cd5cbcf2b9ad235cf4a6f400957a9ad9 /compile.c
parenta9567cc2bfad37cc22b3efe0971ba85bd9c1df34 (diff)
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`.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3033
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/compile.c b/compile.c
index a32a7f1a0b..3c94818641 100644
--- a/compile.c
+++ b/compile.c
@@ -1423,6 +1423,13 @@ iseq_setup(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
debugs("[compile step 6 (update_catch_except_flags)] \n");
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) {
VALUE str = rb_iseq_disasm(iseq);
printf("%s\n", StringValueCStr(str));