• Yukihiro "Matz" Matsumoto's avatar
    Check method existence for Enumerators; fix #3920 · 0a0cc5a2
    Yukihiro "Matz" Matsumoto authored
    The issue #3920 was fixed but the fundamental flaw of lack of stack
    depth check along with fibers still remains, even though it's not
    easy to cause the issue.  Use `MRB_GC_FIXED_ARENA` to avoid the issue
    for workaround.
    
    After this patch, `obj.to_enum` raises `ArgumentError` if the object
    does not respond to the enumerating method. This is incompatible to
    CRuby but I think this behavior is better and CRuby should be updated
    to behave like this.
    0a0cc5a2
enumerator.rb 11.6 KB