summaryrefslogtreecommitdiff
path: root/ext/json/parser/parser.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-02-05 01:30:01 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-02-05 01:30:01 +0000
commit9cc62abc6b0245e5f0e4a8f0cd9b6f53a4f9bf77 (patch)
tree4f7526602484ab86afcdebcef7e84d97610bd69e /ext/json/parser/parser.h
parentbc1e4b4e2aa2a5cf6ab9b4dd3ffd8277298cb95e (diff)
* ext/json/parser/parser.h (GET_PARSER): check if initialized.
[ruby-core:35079] * ext/json/parser/parser.rl (cParser_initialize): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/json/parser/parser.h')
-rw-r--r--ext/json/parser/parser.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/json/parser/parser.h b/ext/json/parser/parser.h
index 688ffdaeba8..5d4532b948a 100644
--- a/ext/json/parser/parser.h
+++ b/ext/json/parser/parser.h
@@ -44,6 +44,9 @@ typedef struct JSON_ParserStruct {
} JSON_Parser;
#define GET_PARSER \
+ GET_PARSER_INIT; \
+ if (!json->Vsource) rb_raise(rb_eArgError, "uninitialized instance")
+#define GET_PARSER_INIT \
JSON_Parser *json; \
Data_Get_Struct(self, JSON_Parser, json)