[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: 5.4 luaL_checkversion vs. loadlib()
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Tue, 16 Jul 2019 12:55:52 -0300
> Specifically, ll_loadlib relies on
> registry[&CLIBS], where &CLIBS is a lightuserdata with the address of a
> static var. If there are multiple copies of the interpreter and you call
> require or loadlib from one other than the one that created the state,
> it'll end up calling lua_getfield on a nil value, which will throw an
> error.
The first thing that luaopen_package does is to create an entry
registry[&CLIBS].