[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Stack Overflow if Library is named taboo.so
- From: Leo Razoumov <slonik.az@...>
- Date: Fri, 31 May 2013 10:53:37 -0400
On Fri, May 31, 2013 at 10:41 AM, Jay Carlson <email@example.com> wrote:
> On May 31, 2013, at 10:07 AM, Owen Shepherd wrote:
>> Leo Razoumov wrote:
>>> Isn't require supposed to set package.loaded[modname] to some true
>>> value*before* it executes the module chunk to prevent a possibility
>>> of an infinite recursion?
> There is no appropriate value for package.loaded to be set to until the package code has finished executing. If require set it to some placeholder
> value, it would just cause errors in other portions of the application.
Yes, it is a touch cookie. But one cannot ignore a possibility that
A->B->C->A and here is a cycle. At least a loader should be able to
identify a cycle and report back an informative message rather than
"recursion depth exceeded".