mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
Fix crash when require
is called from root VM stack
This commit is contained in:
parent
217c14d293
commit
fb324d18aa
1 changed files with 2 additions and 1 deletions
|
@ -43,7 +43,8 @@ static bool isCached(lua_State* L, const std::string& key)
|
|||
static ResolvedRequire resolveRequire(luarequire_Configuration* lrc, lua_State* L, void* ctx, std::string path)
|
||||
{
|
||||
lua_Debug ar;
|
||||
lua_getinfo(L, 1, "s", &ar);
|
||||
if (!lua_getinfo(L, 1, "s", &ar))
|
||||
luaL_error(L, "require is not supported in this context");
|
||||
|
||||
if (!lrc->is_require_allowed(L, ctx, ar.source))
|
||||
luaL_error(L, "require is not supported in this context");
|
||||
|
|
Loading…
Add table
Reference in a new issue