summaryrefslogtreecommitdiff
path: root/ext/json/parser/parser.h
diff options
context:
space:
mode:
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)