lua-yaml: enable aliasing for objects returned by __serialize
The YAML serializer fails to detect aliases in objects returned by the __serialize method: tarantool> x = {} --- ... tarantool> {a = x, b = x} --- - a: &0 [] b: *0 ... tarantool> setmetatable({}, { > __serialize = function() return {a = x, b = x} end, > }) --- - a: [] b: [] ... Fix this by scanning the object returned by the __serialize method (called by luaL_checkfield) for references. Closes #8240 NO_DOC=bug fix
Showing
- changelogs/unreleased/gh-8240-yaml-alias-serialize-fix.md 4 additions, 0 deletionschangelogs/unreleased/gh-8240-yaml-alias-serialize-fix.md
- src/lua/serializer.c 6 additions, 3 deletionssrc/lua/serializer.c
- src/lua/serializer.h 2 additions, 0 deletionssrc/lua/serializer.h
- test/app-luatest/gh_8240_yaml_alias_serialize_test.lua 14 additions, 0 deletionstest/app-luatest/gh_8240_yaml_alias_serialize_test.lua
- third_party/lua-yaml/lyaml.cc 4 additions, 0 deletionsthird_party/lua-yaml/lyaml.cc
Loading