From 773fb5bd6f9ef512d61b87fb13cd88ffc0af3581 Mon Sep 17 00:00:00 2001 From: LoganDark Date: Mon, 8 Nov 2021 15:30:51 -0800 Subject: [PATCH] Don't allow registry to be set to readonly (#184) --- VM/src/lapi.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/VM/src/lapi.cpp b/VM/src/lapi.cpp index f2e97c66..c0c78b93 100644 --- a/VM/src/lapi.cpp +++ b/VM/src/lapi.cpp @@ -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; }