diff options
author | NARUSE, Yui <naruse@airemix.jp> | 2023-01-17 11:20:40 +0900 |
---|---|---|
committer | NARUSE, Yui <naruse@airemix.jp> | 2023-01-17 11:20:40 +0900 |
commit | 49cf0896a2934547c0764aadaec021fb37a2e96f (patch) | |
tree | 0d24c34e8a2064a87ae5fd26ebc653d8fd06dc06 /test | |
parent | a7d467a792c644a7260d6560ea2002fdb8ff6de3 (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.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb index 937f303604..5df3bba5f9 100644 --- a/test/ruby/test_gc.rb +++ b/test/ruby/test_gc.rb @@ -305,6 +305,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" } |