summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2019-04-23 15:16:17 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2019-04-23 15:29:16 -0700
commitf3a37e6bc1c2a98bfc9fafc389ea05622c744af9 (patch)
tree60e79774b7bf6fc1467ce87fe0b0c93b91bf2609
parent4204f96dbee91a4883d2a7b85c3070c18e9ce9dc (diff)
downloadpsych-f3a37e6bc1c2a98bfc9fafc389ea05622c744af9.tar.gz
syntax error can move, so do not cache
-rw-r--r--ext/psych/psych_parser.c4
1 files changed, 2 insertions, 2 deletions
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 @@
#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)
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)
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);