Skip to content
  • Peter Zhu's avatar
    71babe55
    Use 32-bit integers for redblack_id_t · 71babe55
    Peter Zhu authored
    On 32-bit systems, the shape cache size is 1048576 (value of
    REDBLACK_CACHE_SIZE), but a 16-bit unsigned integer can only go up to
    65536. This means that the redblack_id_t can overflow and lead to a
    corrupted red-black tree.
    
    The following script crashes on 32-bit systems:
    
        o = Object.new
        1_000_000.times do |i|
          o.instance_variable_set(:"@i#{i}", i)
        end
    71babe55
    Use 32-bit integers for redblack_id_t
    Peter Zhu authored
    On 32-bit systems, the shape cache size is 1048576 (value of
    REDBLACK_CACHE_SIZE), but a 16-bit unsigned integer can only go up to
    65536. This means that the redblack_id_t can overflow and lead to a
    corrupted red-black tree.
    
    The following script crashes on 32-bit systems:
    
        o = Object.new
        1_000_000.times do |i|
          o.instance_variable_set(:"@i#{i}", i)
        end
Loading