summaryrefslogtreecommitdiff
path: root/xmake/core/base/serialize.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2019-09-05 22:46:09 +0800
committerruki <[email protected]>2019-09-05 10:36:55 +0800
commitd97fce1b5121c0dd7e06528c7e429afc738a8a68 (patch)
treee7dd8e8eaa78f6749cacfc15fa1d043903ff4a5b /xmake/core/base/serialize.lua
parentcd8458c4f16a8e22f688934162c97784b8b33297 (diff)
fix serialize/makeref
Diffstat (limited to 'xmake/core/base/serialize.lua')
-rw-r--r--xmake/core/base/serialize.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/xmake/core/base/serialize.lua b/xmake/core/base/serialize.lua
index 423c9dc45..37fbc52f8 100644
--- a/xmake/core/base/serialize.lua
+++ b/xmake/core/base/serialize.lua
@@ -198,11 +198,13 @@ function serialize._makeref(pathsegs, opt)
return "ref()"
end
+ -- use replicas to avoid infinite generation of nested strings, e.g ref("\"xx\"") => ref("\\\"xx\\\"") => ..
+ local pathrefs = {}
for i, v in ipairs(pathsegs) do
- pathsegs[i] = serialize._make(v, opt)
+ pathrefs[i] = serialize._make(v, opt)
end
- return "ref(" .. table.concat(pathsegs, opt.indentstr and ", " or ",") .. ")"
+ return "ref(" .. table.concat(pathrefs, opt.indentstr and ", " or ",") .. ")"
end
function serialize._resolveref(root, fenv, ...)