diff --git a/TODO.md b/TODO.md index b1e38c2..b96331d 100644 --- a/TODO.md +++ b/TODO.md @@ -1,7 +1,6 @@ # For MVP functionality - fix coloring issue in UlOS 2 beta 5 (and in OpenOS `dmesg`, it appears color-mapper is wrong) -- fix FrostOS crash due to empty syscalls table (unsure what is happening) - make `computer` component use callbacks - make a lot of stuff which likely will need to be indirect actually be indirect (modem comms, computer funcs) - make beeps, power, etc. be callbacks on one shared local state (computer environment) diff --git a/src/machine.lua b/src/machine.lua index 777e755..791828e 100644 --- a/src/machine.lua +++ b/src/machine.lua @@ -286,7 +286,13 @@ sandbox = { rawlen = rawlen, rawset = rawset, select = select, - setmetatable = setmetatable, + setmetatable = function(t, meta) + if type(meta) == "table" then + -- nope + rawset(meta, "__gc", nil) + end + return setmetatable(t, meta) + end, tonumber = tonumber, tostring = tostring, type = type, @@ -308,8 +314,8 @@ sandbox = { debug = { getinfo = debug.getinfo, traceback = debug.traceback, - getlocal = debug.getlocal, - getupvalue = debug.getupvalue, + getlocal = function(...) return (debug.getlocal(...)) end, + getupvalue = function(...) return (debug.getupvalue(...)) end, print = debug.print, },