On Mon, Oct 24, 2016 at 03:34:02PM +0200, demerphq wrote: > On 24 October 2016 at 15:28, Dan Collins <dcollinsn@gmail.com> wrote: > > This seems reasonable. I had expected "fresh_perl" to hide those failures, > > but that seems to be /very/ platform dependent. Let's just skip that test > > altogether. > > What about just fixing it? > > If we say that you cannot trigger an overload for an object inside an > overload handler that was called by overload to handle that object > then we could prevent this type of error. > > IOW before every overload call we would check a global hash to see if > the object was in the hash, if it was then we would die with an > exception. If it was not then we would add it to the hash. When the > overload method we called exited we would remove the object from the > hash. (We could also attach some kind of attribute to the object to > say it was inside of an overload call.) > > It would slow down overload methods a touch, but it would not segfault. We would have to also make sure the hash entry was removed if we die. Also, can it ever be reasonable to call an overload handler recursively on the same object? -- "You're so sadly neglected, and often ignored. A poor second to Belgium, When going abroad." -- Monty Python, "Finland"Thread Previous | Thread Next