From 19d3c80e8136402a26b52c8da46eee071ec413d6 Mon Sep 17 00:00:00 2001 From: 卜部昌平 Date: Wed, 31 Jul 2019 23:15:56 +0900 Subject: calc_lineno(): add assertions This function has a lot of assumptions. Should make them sure. --- vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vm.c') diff --git a/vm.c b/vm.c index 0759ef2a01..593540a32e 100644 --- a/vm.c +++ b/vm.c @@ -1343,7 +1343,7 @@ rb_source_location(int *pline) const rb_execution_context_t *ec = GET_EC(); const rb_control_frame_t *cfp = rb_vm_get_ruby_level_next_cfp(ec, ec->cfp); - if (cfp && cfp->iseq) { + if (cfp && VM_FRAME_RUBYFRAME_P(cfp)) { if (pline) *pline = rb_vm_get_sourceline(cfp); return rb_iseq_path(cfp->iseq); } -- cgit v1.2.3