summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-16 05:35:58 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-16 05:35:58 +0000
commit7a666c67664053df9e749cc81d17a2312881d436 (patch)
tree5de1660d0ad3125cee29d9d8e675bd42f329c5ff /vm.c
parentb3cab0dc74da4349a4b478ed0de2b4578da542bc (diff)
rb_source_location() may return nil.
* vm.c (rb_source_location): return nil if path is not found. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/vm.c b/vm.c
index 9ee90a52fd..e5f2c2fd99 100644
--- a/vm.c
+++ b/vm.c
@@ -1293,7 +1293,7 @@ rb_source_location(int *pline)
}
else {
if (pline) *pline = 0;
- return 0;
+ return Qnil;
}
}
@@ -1301,7 +1301,7 @@ const char *
rb_source_loc(int *pline)
{
VALUE path = rb_source_location(pline);
- if (!path) return 0;
+ if (!NIL_P(path)) return NULL;
return RSTRING_PTR(path);
}