greybel-vs icon indicating copy to clipboard operation
greybel-vs copied to clipboard

Self-referential __isa can blow up the call stack when passed through an extension function

Open Olipro opened this issue 1 year ago • 0 comments

This is a fun one:

Foo = {}
Foo.__isa = Foo

map.errCheck = function()
    return self
end function

a = new Foo //-- or just Foo.
if a.errCheck isa Foo then print 1

Runtime error: Maximum call stack size exceeded

Olipro avatar Oct 22 '23 00:10 Olipro