aboutsummaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-08 14:47:38 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-08 14:47:38 +0000
commit8a70b942bd626964ec3786136f7c4a58ff9bba89 (patch)
tree9ae8be0fc055a8315d59e63563b41a590b50a45a /compile.c
parent5c32e47a38bc715b365ee8e34336e0365abf2ffe (diff)
downloadruby-8a70b942bd626964ec3786136f7c4a58ff9bba89.tar.gz
compile.c: make opt a string value
* compile.c (iseq_ibf_dump): rb_check_string_type() returns nil if the object does not have to_str method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/compile.c b/compile.c
index ce69b00729..3dbed3829c 100644
--- a/compile.c
+++ b/compile.c
@@ -8064,9 +8064,10 @@ iseq_ibf_dump(const rb_iseq_t *iseq, VALUE opt)
header.size = ibf_dump_pos(&dump);
if (RTEST(opt)) {
- VALUE opt_str = rb_check_string_type(opt);
+ VALUE opt_str = opt;
+ const char *ptr = StringValuePtr(opt_str);
header.extra_size = RSTRING_LENINT(opt_str) + 1;
- ibf_dump_write(&dump, RSTRING_PTR(opt_str), header.extra_size);
+ ibf_dump_write(&dump, ptr, header.extra_size);
}
else {
header.extra_size = 0;