Actions
Bug #19381
closedSEGV - ivars, both Ubuntu & Windows
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.3.0dev (2023-01-26T07:31:08Z master 6422fef90c) [x86_64-linux]
Description
I've used code similar to the below for a long time. When max is set to 50, it runs. When max is set to 51, it SEGV faults.
Rubies tested:
ruby 3.3.0dev (2023-01-26T07:31:08Z master 6422fef90c) [x86_64-linux]
ruby 3.3.0dev (2023-01-26T07:31:08Z master 6422fef90c) [x64-mingw-ucrt]
ruby 3.3.0dev (2023-01-26T07:31:08Z master 6422fef90c) [x64-mswin64_140]
I suspect it involves the changes in https://github.com/ruby/ruby/pull/7183 'Limit maximum number of IVs on a shape'
module Test
class << self
def run
max = 51
(1..max).each do |v|
instance_variable_set("@iv#{v}".to_sym, nil)
end
end
end
end
Test.run
puts Test.instance_variables
Actions
Like0
Like0Like0Like0Like0Like0