ruby-changes:55503
From: Aaron <ko1@a...>
Date: Wed, 24 Apr 2019 21:24:44 +0900 (JST)
Subject: [ruby-changes:55503] Aaron Patterson:19d454a957 (trunk): syntax error can move, so do not cach=e=
Aaron Patterson 2019-04-24 07:16:17 +0900 (Wed, 24 Apr 2019) New Revision: 19d454a957 https://git.ruby-lang.org/ruby.git/commit/?id=3D19d454a957 Log: syntax error can move, so do not cache Modified files: ext/psych/psych_parser.c= From 19d454a957836a6118f42b0367aea7c823beffae Mon Sep 17 00:00:00 2001 From: Aaron Patterson <tenderlove@r...> Date: Tue, 23 Apr 2019 15:16:17 -0700 Subject: syntax error can move, so do not cache diff --git a/ext/psych/psych_parser.c b/ext/psych/psych_parser.c index 8eb2205..6e58611 100644 --- a/ext/psych/psych_parser.c +++ b/ext/psych/psych_parser.c @@ -1,7 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/#L1 #include <psych.h> VALUE cPsychParser; -VALUE ePsychSyntaxError; static ID id_read; static ID id_path; @@ -85,6 +84,8 @@ static VALUE make_exception(yaml_parser_t * parser, VALUE path) https://github.com/ruby/ruby/blob/trunk/#L84 line = parser->context_mark.line + 1; column = parser->context_mark.column + 1; + VALUE ePsychSyntaxError = rb_const_get(mPsych, rb_intern("SyntaxError")); + return rb_funcall(ePsychSyntaxError, rb_intern("new"), 6, path, INT2NUM(line), @@ -569,7 +570,6 @@ void Init_psych_parser(void) https://github.com/ruby/ruby/blob/trunk/#L570 rb_define_const(cPsychParser, "UTF16BE", INT2NUM(YAML_UTF16BE_ENCODING)); rb_require("psych/syntax_error"); - ePsychSyntaxError = rb_const_get(mPsych, rb_intern("SyntaxError")); rb_define_method(cPsychParser, "parse", parse, -1); rb_define_method(cPsychParser, "mark", mark, 0); -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/