[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Stack Overflow if Library is named taboo.so
- From: Owen Shepherd <owen.shepherd@...>
- Date: Fri, 31 May 2013 15:07:11 +0100
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? If it is not the case and require can cause
an infinite recursion then it is a bug in Lua module system.
Requiring modules can produce cycles (directly or indirectly) and a
package loader should be prepared to handle this possibility.
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.