From 0fbc918889eee48bc1e1cbff1682474cd1e7bcaa Mon Sep 17 00:00:00 2001 From: LoganDark Date: Mon, 8 Nov 2021 12:30:54 -0800 Subject: [PATCH] api_check --- VM/src/lapi.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/VM/src/lapi.cpp b/VM/src/lapi.cpp index 5de44441..a10e73b7 100644 --- a/VM/src/lapi.cpp +++ b/VM/src/lapi.cpp @@ -704,8 +704,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); - if (value && t == hvalue(registry(L))) - luaG_runerror(L, "Attempt to set the registry to readonly"); + api_check(L, t != hvalue(registry(L))); t->readonly = value; return; }