summaryrefslogtreecommitdiff
path: root/xmake/core/base/serialize.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2025-04-19 00:42:27 +0800
committerruki <[email protected]>2025-08-28 11:35:53 +0800
commit9de0be5040e3feda8aface1174cd1e6fc696fe4e (patch)
treeb9256e58a7acfe57d8d6252277f8247b74bfa56d /xmake/core/base/serialize.lua
parent5c371c00ead44993b83f26a754c32a3f8a799aa4 (diff)
bind sandbox
Diffstat (limited to 'xmake/core/base/serialize.lua')
-rw-r--r--xmake/core/base/serialize.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/xmake/core/base/serialize.lua b/xmake/core/base/serialize.lua
index b45d5587f..665fe04a6 100644
--- a/xmake/core/base/serialize.lua
+++ b/xmake/core/base/serialize.lua
@@ -167,7 +167,6 @@ function serialize._makefunction(func, opt)
end
function serialize._resolvefunction(root, fenv, bytecode)
- -- check
if type(bytecode) ~= "string" then
return nil, string.format("invalid bytecode (string expected, got %s)", type(bytecode))
end
@@ -191,7 +190,10 @@ function serialize._resolvefunction(root, fenv, bytecode)
if upname == nil or upname == "" then
break
end
- debug.setupvalue(func, i, fenv[upname])
+ local upvalue = fenv[upname]
+ if upvalue ~= nil then
+ debug.setupvalue(func, i, upvalue)
+ end
end
end
return func
@@ -477,8 +479,6 @@ end
-- @return obj, errors
--
function serialize.load(str)
-
- -- check
assert(str)
-- load string