aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSunil Nimmagadda <sunil@nimmagadda.net>2026-10-30 17:19:38 +0530
committerSunil Nimmagadda <sunil@nimmagadda.net>2026-10-30 17:19:38 +0530
commitfce1d5be19d81b144fdd242799dc699ee1291369 (patch)
tree8b5e724702002ba1f0024c74017d40c6438ad83a
parent91fe7eab0aa3e91bb694d6dd86f87dc7d0305364 (diff)
Type check individual segment/section entry.
-rw-r--r--mkelf.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/mkelf.lua b/mkelf.lua
index 3ad7dba..b7c693a 100644
--- a/mkelf.lua
+++ b/mkelf.lua
@@ -43,6 +43,9 @@ local function loadconfig(fn)
error("segments must be a table", 2)
end
for _, segment in ipairs(t) do
+ if type(segment) ~= "table" then
+ error("segment must be a table", 2)
+ end
segment = setmetatable(segment, segment_mt)
segment:normalize()
segment:validate()
@@ -54,6 +57,9 @@ local function loadconfig(fn)
error("sections must be a table", 2)
end
for _, section in ipairs(t) do
+ if type(section) ~= "table" then
+ error("section must be a table", 2)
+ end
section = setmetatable(section, section_mt)
section:normalize()
section:validate()