Don't allow registry to be set to readonly (#184)

This commit is contained in:
LoganDark 2021-11-08 15:30:51 -08:00 committed by GitHub
parent 7816f2596f
commit 773fb5bd6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -703,6 +703,7 @@ void lua_setreadonly(lua_State* L, int objindex, bool value)
const TValue* o = index2adr(L, objindex);
api_check(L, ttistable(o));
Table* t = hvalue(o);
api_check(L, t != hvalue(registry(L)));
t->readonly = value;
return;
}