summaryrefslogtreecommitdiff
path: root/ext/json
diff options
context:
space:
mode:
Diffstat (limited to 'ext/json')
-rw-r--r--ext/json/generator/generator.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/json/generator/generator.c b/ext/json/generator/generator.c
index 06509ca..1b9652d 100644
--- a/ext/json/generator/generator.c
+++ b/ext/json/generator/generator.c
@@ -965,6 +965,7 @@ static VALUE cState_init_copy(VALUE obj, VALUE orig)
{
JSON_Generator_State *objState, *origState;
+ if (obj == orig) return obj;
Data_Get_Struct(obj, JSON_Generator_State, objState);
Data_Get_Struct(orig, JSON_Generator_State, origState);
if (!objState) rb_raise(rb_eArgError, "unallocated JSON::State");