From e4330536d2f4a9b96e52a60b9d698625ab26a547 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Thu, 17 Oct 2024 13:39:48 -0400 Subject: [PATCH] [ruby/json] Fix State#max_nesting= Returning state->max_nesting is not valid because it's not a Ruby object. https://github.com/ruby/json/commit/6679ceb --- ext/json/generator/generator.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/json/generator/generator.c b/ext/json/generator/generator.c index b9946b3cf7..ead772994b 100644 --- a/ext/json/generator/generator.c +++ b/ext/json/generator/generator.c @@ -1164,7 +1164,8 @@ static VALUE cState_max_nesting_set(VALUE self, VALUE depth) { GET_STATE(self); Check_Type(depth, T_FIXNUM); - return state->max_nesting = FIX2LONG(depth); + state->max_nesting = FIX2LONG(depth); + return Qnil; } /*