diff options
| author | ruki <[email protected]> | 2019-09-05 22:46:09 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-09-05 10:36:55 +0800 |
| commit | d97fce1b5121c0dd7e06528c7e429afc738a8a68 (patch) | |
| tree | e7dd8e8eaa78f6749cacfc15fa1d043903ff4a5b /xmake/core/base/serialize.lua | |
| parent | cd8458c4f16a8e22f688934162c97784b8b33297 (diff) | |
fix serialize/makeref
Diffstat (limited to 'xmake/core/base/serialize.lua')
| -rw-r--r-- | xmake/core/base/serialize.lua | 6 |
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, ...) |
