Lunatic: make -Lopts=strict also error on some table reads w/ nonexistent keys.

Specifically, for the tables returned with require"DEFS" etc. This allows to
check if maybe parts of a bundle of files is missing (because comparisons like
"spr.picnum == D.NONEXISTENT_NAME" do not yield errors normally).

git-svn-id: https://svn.eduke32.com/eduke32@4050 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2013-09-05 17:37:47 +00:00
parent 1328c66f9c
commit 85aa90d82c

View file

@ -2482,7 +2482,9 @@ if (concode) then
local function protect_con_table(tab)
-- NOTE: Some of our code specifically excepts the name tables to be
-- indexable with nonexistent keys. See e.g. control.c: _A_SpawnGlass()
-- tab = setmetatable(tab, index_error_mt)
if (ffiC._LUNATIC_STRICT ~= 0) then
tab = setmetatable(tab, index_error_mt)
end
return setmtonce({}, { __index=tab, __newindex=basemod_newidx })
end