diff options
Diffstat (limited to 'deps/lua/src/lvm.c')
-rw-r--r-- | deps/lua/src/lvm.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/deps/lua/src/lvm.c b/deps/lua/src/lvm.c index e0a0cd852..5cd313b5e 100644 --- a/deps/lua/src/lvm.c +++ b/deps/lua/src/lvm.c @@ -138,6 +138,8 @@ void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) { const TValue *tm; if (ttistable(t)) { /* `t' is a table? */ Table *h = hvalue(t); + if (h->readonly) + luaG_runerror(L, "Attempt to modify a readonly table"); TValue *oldval = luaH_set(L, h, key); /* do a primitive set */ if (!ttisnil(oldval) || /* result is no nil? */ (tm = fasttm(L, h->metatable, TM_NEWINDEX)) == NULL) { /* or no TM? */ |