api_check

This commit is contained in:
LoganDark 2021-11-08 12:30:54 -08:00
parent f76b693dfb
commit 0fbc918889
No known key found for this signature in database
GPG key ID: B8C37CEDE1AC60EA

View file

@ -704,8 +704,7 @@ void lua_setreadonly(lua_State* L, int objindex, bool value)
const TValue* o = index2adr(L, objindex); const TValue* o = index2adr(L, objindex);
api_check(L, ttistable(o)); api_check(L, ttistable(o));
Table* t = hvalue(o); Table* t = hvalue(o);
if (value && t == hvalue(registry(L))) api_check(L, t != hvalue(registry(L)));
luaG_runerror(L, "Attempt to set the registry to readonly");
t->readonly = value; t->readonly = value;
return; return;
} }