summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authoryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-05-13 12:31:38 (GMT)
committeryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-05-13 12:31:38 (GMT)
commit8b88f70a842009d88feb6d46c4015ba9f15585c0 (patch)
treee370efd0aa2c1f1875e09961bc0f0ff8f500a7c6 /compile.c
parent83be2ce40fa0d7e39f7386d0973b7560efd09576 (diff)
compile.c: Fix segfault when VM_INSN_INFO_TABLE_IMPL is not 2
* compile.c (ibf_dump_iseq_each): Fix a range of a conditional. `positions` is only used when VM_INSN_INFO_TABLE_IMPL is 2. And always `dump_body` is expected to be initialized by `iseq->body`. For example, `dump_body->insns_info.size` is used in `ibf_dump_insns_info_positions`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/compile.c b/compile.c
index 9ab43e3..33b3b2d 100644
--- a/compile.c
+++ b/compile.c
@@ -8900,10 +8900,10 @@ static ibf_offset_t
ibf_dump_iseq_each(struct ibf_dump *dump, const rb_iseq_t *iseq)
{
struct rb_iseq_constant_body dump_body;
- unsigned int *positions;
#if VM_INSN_INFO_TABLE_IMPL == 2
- dump_body = *iseq->body;
+ unsigned int *positions;
#endif
+ dump_body = *iseq->body;
dump_body.location.pathobj = ibf_dump_object(dump, dump_body.location.pathobj); /* TODO: freeze */
dump_body.location.base_label = ibf_dump_object(dump, dump_body.location.base_label);