summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-04-05 07:04:39 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-04-05 07:04:39 (GMT)
commitbc6e61f149deaf1f74e04af9c5e32683e6b39644 (patch)
treeab64ee958d73d4b7ccc58e7bddde5f9437e7a5ac /iseq.c
parent04dfc46ad0918964260d095b8f58e35eff5a33af (diff)
compile.c: do not dump pointers
* compile.c (ibf_dump_iseq_each): do not dump succ_index_table pointer. positions are dumped as integer arrays. pointer values are meaningless outside the process. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/iseq.c b/iseq.c
index 9c0122a..68ad9a3 100644
--- a/iseq.c
+++ b/iseq.c
@@ -498,15 +498,14 @@ rb_iseq_insns_info_encode_positions(const rb_iseq_t *iseq)
#endif
}
-void
-rb_iseq_insns_info_decode_positions(const rb_iseq_t *iseq)
+unsigned int *
+rb_iseq_insns_info_decode_positions(const struct rb_iseq_constant_body *body)
{
#if VM_INSN_INFO_TABLE_IMPL == 2
- int size = iseq->body->insns_info.size;
- int max_pos = iseq->body->iseq_size;
- struct succ_index_table *sd = iseq->body->insns_info.succ_index_table;
- if (iseq->body->insns_info.positions) ruby_xfree(iseq->body->insns_info.positions);
- iseq->body->insns_info.positions = succ_index_table_invert(max_pos, sd, size);
+ int size = body->insns_info.size;
+ int max_pos = body->iseq_size;
+ struct succ_index_table *sd = body->insns_info.succ_index_table;
+ return succ_index_table_invert(max_pos, sd, size);
#endif
}