summaryrefslogtreecommitdiff
path: root/test/ruby/test_lambda.rb
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2023-03-07 09:50:30 -0500
committerPeter Zhu <peter@peterzhu.ca>2023-03-08 08:47:18 -0500
commite1bd45624c85e8a80991bda20801f50967ac77a1 (patch)
tree5ddb643dc47a1e63f44dd331fcd0c06caaa4ca84 /test/ruby/test_lambda.rb
parentbead4bce3b4544cb61b3c05c11204a377e20cdfa (diff)
Fix crash when allocating classes with newobj hook
We need to zero out the whole slot when running the newobj hook for a newly allocated class because the slot could be filled with garbage, which would cause a crash if a GC runs inside of the newobj hook. For example, the following script crashes: ``` require "objspace" GC.stress = true ObjectSpace.trace_object_allocations { 100.times do Class.new end } ``` [Bug #19482]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/7464
Diffstat (limited to 'test/ruby/test_lambda.rb')
0 files changed, 0 insertions, 0 deletions