From 0331314d278d0590ff26eb7ec156f859b590464f Mon Sep 17 00:00:00 2001 From: tenderlove Date: Sat, 22 Jan 2011 01:13:52 +0000 Subject: * ext/psych/parser.c (parse): fix assertion error when reusing a parser after an exception has been raised * test/psych/test_parser.rb: test for assertion error git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/psych/parser.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ext/psych/parser.c') diff --git a/ext/psych/parser.c b/ext/psych/parser.c index 071b8c0720..5a9d2c75f9 100644 --- a/ext/psych/parser.c +++ b/ext/psych/parser.c @@ -96,6 +96,9 @@ static VALUE parse(VALUE self, VALUE yaml) size_t line = parser->mark.line; size_t column = parser->mark.column; + yaml_parser_delete(parser); + yaml_parser_initialize(parser); + rb_raise(ePsychSyntaxError, "couldn't parse YAML at line %d column %d", (int)line, (int)column); } -- cgit v1.2.3