lyaml: fix alias serialization
The #8350 was introduced by the commit b42302f5 ("lua-yaml: enable aliasing for objects returned by __serialize") so the patch is effectively reversed. The idea is to call all object __serialize methods recursively before finding references. The new serialization pass stores the mapping from the original object to the serialized representation. After this, the reference analysis pass and the encoding pass use this mapping to replace original objects with the serialized representation. As result, the reference analysis has a complete information about objects and no references are missed. Closes #8350 Closes #8310 Closes #8321 NO_DOC=bugfix Co-authored-by:Nikolay Shirokovskiy <nshirokovskiy@tarantool.org> (cherry picked from commit 610f5fb7)
Showing
- changelogs/unreleased/fix-yaml-alias-serialization.md 3 additions, 0 deletionschangelogs/unreleased/fix-yaml-alias-serialization.md
- src/lua/serializer.c 150 additions, 2 deletionssrc/lua/serializer.c
- src/lua/serializer.h 38 additions, 2 deletionssrc/lua/serializer.h
- src/lua/utils.c 18 additions, 0 deletionssrc/lua/utils.c
- src/lua/utils.h 7 additions, 0 deletionssrc/lua/utils.h
- test/app-luatest/serializer_test.lua 64 additions, 0 deletionstest/app-luatest/serializer_test.lua
- test/box/tuple.result 6 additions, 6 deletionstest/box/tuple.result
- third_party/lua-yaml/lyaml.cc 25 additions, 9 deletionsthird_party/lua-yaml/lyaml.cc
Loading
Please register or sign in to comment