diff --git a/ext/oj/dump_compat.c b/ext/oj/dump_compat.c index ea3f11c6..36d6160a 100644 --- a/ext/oj/dump_compat.c +++ b/ext/oj/dump_compat.c @@ -896,7 +896,11 @@ void oj_dump_compat_val(VALUE obj, int depth, Out out, bool as_ok) { if (0 < out->argc) { set_state_depth(*out->argv, depth); } +#ifdef TRUFFLERUBY + rb_raise(rb_eArgError, "Too deeply nested."); +#else raise_json_err("Too deeply nested", "NestingError"); +#endif } #endif }