summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Felgentreff <timfelgentreff@gmail.com>2011-08-09 15:07:32 -0700
committerTim Felgentreff <timfelgentreff@gmail.com>2011-08-09 15:07:32 -0700
commitb6b622db8cc36c334e6dd635e8cdbf62bb35f172 (patch)
treef8e52c5d91d365f1e96bf927ffb5dd35fff1ab50
parentcc178803a1e38c7f03b0d23984ba50042d40dcb5 (diff)
downloadjson-b6b622db8cc36c334e6dd635e8cdbf62bb35f172.tar.gz
Throwing this error on Maglev is inappropriate
-rw-r--r--ext/json/ext/parser/parser.c2
-rw-r--r--ext/json/ext/parser/parser.rl2
2 files changed, 4 insertions, 0 deletions
diff --git a/ext/json/ext/parser/parser.c b/ext/json/ext/parser/parser.c
index b28a6fc..5cee27d 100644
--- a/ext/json/ext/parser/parser.c
+++ b/ext/json/ext/parser/parser.c
@@ -1649,9 +1649,11 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
GET_PARSER_INIT;
init_count += 1;
+#ifndef MAGLEV
if (json->Vsource) {
rb_raise(rb_eTypeError, "already initialized instance");
}
+#endif
rb_scan_args(argc, argv, "11", &source, &opts);
source = convert_encoding(StringValue(source));
ptr = RSTRING_PTR(source);
diff --git a/ext/json/ext/parser/parser.rl b/ext/json/ext/parser/parser.rl
index fad8ac7..feb0093 100644
--- a/ext/json/ext/parser/parser.rl
+++ b/ext/json/ext/parser/parser.rl
@@ -647,9 +647,11 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
GET_PARSER_INIT;
init_count += 1;
+#ifndef MAGLEV
if (json->Vsource) {
rb_raise(rb_eTypeError, "already initialized instance");
}
+#endif
rb_scan_args(argc, argv, "11", &source, &opts);
source = convert_encoding(StringValue(source));
ptr = RSTRING_PTR(source);