ext/oj/object.c in oj-2.7.2 vs ext/oj/object.c in oj-2.7.3

- old
+ new

@@ -189,11 +189,13 @@ if (0 == len) { oj_set_error_at(pi, oj_parse_error_class, __FILE__, __LINE__, "Invalid struct data"); return 1; } + // If struct is not defined then we let this fail and raise an exception. - sc = rb_const_get(oj_struct_class, rb_to_id(*RARRAY_PTR(value))); + sc = oj_name2struct(pi, *RARRAY_PTR(value)); + // Create a properly initialized struct instance without calling the initialize method. parent->val = rb_obj_alloc(sc); // If the JSON array has more entries than the struct class allows, we record an error. #ifdef RSTRUCT_LEN // MRI >= 1.9