From da4027a15f16b482eee521df0612253f65b6d8b9 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 6 Mar 2026 09:44:05 +0900 Subject: [PATCH] Release AST nodes after visiting array elements --- lib/rubygems/safe_marshal/visitors/to_ruby.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/rubygems/safe_marshal/visitors/to_ruby.rb b/lib/rubygems/safe_marshal/visitors/to_ruby.rb index a1f94817760e..5a5e6f398389 100644 --- a/lib/rubygems/safe_marshal/visitors/to_ruby.rb +++ b/lib/rubygems/safe_marshal/visitors/to_ruby.rb @@ -48,6 +48,7 @@ def visit_Gem_SafeMarshal_Elements_Array(a) while idx < size push_stack idx array << visit(elements[idx]) + elements[idx] = nil # release AST node for GC idx += 1 end