summaryrefslogtreecommitdiff
path: root/ext/psych
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-22 01:13:52 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-22 01:13:52 +0000
commit0331314d278d0590ff26eb7ec156f859b590464f (patch)
tree47060a334fc4212a01f49a960af4497f499a4137 /ext/psych
parent960720ef4fd9662d94bbc25d5a6cfcaa313450a3 (diff)
* 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
Diffstat (limited to 'ext/psych')
-rw-r--r--ext/psych/parser.c3
1 files changed, 3 insertions, 0 deletions
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);
}