summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@ruby-lang.org>2023-03-21 12:23:37 +0900
committernagachika <nagachika@ruby-lang.org>2023-03-21 12:23:37 +0900
commit782a9c2ddfcc84c3bd3a1fa153f7ac1f3e92a2e1 (patch)
treef69d79f3fd503b8d387e882e184190664287d4d4 /test
parentc660aaf439dcd609e4e23253372c8ec6d567ce10 (diff)
merge revision(s) 90a80eb076429978e720e11fb17a3cbb96de3454: [Backport #19284]
Fix integer underflow when using HEAP_INIT_SLOTS There is an integer underflow when the environment variable RUBY_GC_HEAP_INIT_SLOTS is less than the number of slots currently in the Ruby heap. [Bug #19284] --- gc.c | 25 +++++++++++++------------ test/ruby/test_gc.rb | 5 +++++ 2 files changed, 18 insertions(+), 12 deletions(-)
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_gc.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb
index baf9971c48..c28f450ef1 100644
--- a/test/ruby/test_gc.rb
+++ b/test/ruby/test_gc.rb
@@ -214,6 +214,11 @@ class TestGc < Test::Unit::TestCase
def test_gc_parameter
env = {
+ "RUBY_GC_HEAP_INIT_SLOTS" => "100"
+ }
+ assert_in_out_err([env, "-e", "exit"], "", [], [], "[Bug #19284]")
+
+ env = {
"RUBY_GC_MALLOC_LIMIT" => "60000000",
"RUBY_GC_HEAP_INIT_SLOTS" => "100000"
}