summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-03 09:06:28 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-03 09:06:28 +0000
commit18c79781616f3a1d502c3c4061da2d8893f1e4ca (patch)
tree182ab89fa8c4b940773931bedf409df7c09e26a6 /vm.c
parent45cdc834c4b25b09d9263fc4b6a6c2b6432abdc6 (diff)
vm.c (rb_source_location): check for NULL cfp->iseq
rb_vm_get_sourceline returns zero if cfp->iseq is NULL, so rb_iseq_path should not try to follow NULL cfp->iseq, either. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 3cc0f94..efdbff9 100644
--- a/vm.c
+++ b/vm.c
@@ -1291,7 +1291,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) {
+ if (cfp && cfp->iseq) {
if (pline) *pline = rb_vm_get_sourceline(cfp);
return rb_iseq_path(cfp->iseq);
}