diff options
author | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-10 23:50:50 +0000 |
---|---|---|
committer | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-10 23:50:50 +0000 |
commit | b9617bf7cb195924b47cf026d0638253b1bc02de (patch) | |
tree | 549d2486ae2ebe23a8ec4d8fc5dc22e434c2fa10 /ext | |
parent | 7be704b359cb4de29a3ce7599c6a6afaa399de44 (diff) | |
download | ruby-b9617bf7cb195924b47cf026d0638253b1bc02de.tar.gz |
* ext/psych/parser.c: Fixing a segv in test-all. Thanks Yusuke!
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/psych/parser.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/psych/parser.c b/ext/psych/parser.c index 5f5b2537c6..f814091502 100644 --- a/ext/psych/parser.c +++ b/ext/psych/parser.c @@ -57,10 +57,10 @@ static VALUE parse(VALUE self, VALUE yaml) if(rb_respond_to(yaml, id_read)) { yaml_parser_set_input(&parser, io_reader, (void *)yaml); } else { - Check_Type(yaml, T_STRING); + StringValue(yaml); yaml_parser_set_input_string( &parser, - (const unsigned char *)StringValuePtr(yaml), + (const unsigned char *)RSTRING_PTR(yaml), (size_t)RSTRING_LEN(yaml) ); } |