From b9617bf7cb195924b47cf026d0638253b1bc02de Mon Sep 17 00:00:00 2001 From: tenderlove Date: Sat, 10 Apr 2010 23:50:50 +0000 Subject: * 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 --- ext/psych/parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext') 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) ); } -- cgit v1.2.3