summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2019-07-31 23:15:56 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2019-08-01 16:00:59 +0900
commit19d3c80e8136402a26b52c8da46eee071ec413d6 (patch)
tree7649a44bf5ff014070e525e922d09fe12d3567f2 /vm.c
parent5d33f787169bcc3594d2264726695d58c4a06899 (diff)
calc_lineno(): add assertions
This function has a lot of assumptions. Should make them sure.
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c2
1 files changed, 1 insertions, 1 deletions
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);
}