From: Remi Gacogne Date: Fri, 7 Jul 2017 08:27:07 +0000 (+0200) Subject: LuaWrapper: Don't move the content of vectors, maps and unordered_maps X-Git-Tag: rec-4.1.0-alpha1~29^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F5502%2Fhead;p=thirdparty%2Fpdns.git LuaWrapper: Don't move the content of vectors, maps and unordered_maps They might hold shared pointers, and moving them cause the source to become empty. luawrapper f9c686e2fa3ad5cf5593265dda491239e32e2955 --- diff --git a/ext/luawrapper/include/LuaContext.hpp b/ext/luawrapper/include/LuaContext.hpp index 9416c906c3..d0ffe6f6be 100644 --- a/ext/luawrapper/include/LuaContext.hpp +++ b/ext/luawrapper/include/LuaContext.hpp @@ -2607,7 +2607,7 @@ struct LuaContext::Reader>> return {}; } - result.push_back({ std::move(val1.get()), std::move(val2.get()) }); + result.push_back({ val1.get(), val2.get() }); lua_pop(state, 1); // we remove the value but keep the key for the next iteration } catch(...) { @@ -2645,7 +2645,7 @@ struct LuaContext::Reader> return {}; } - result.insert({ std::move(key.get()), std::move(value.get()) }); + result.insert({ key.get(), value.get() }); lua_pop(state, 1); // we remove the value but keep the key for the next iteration } catch(...) { @@ -2683,7 +2683,7 @@ struct LuaContext::Reader> return {}; } - result.insert({ std::move(key.get()), std::move(value.get()) }); + result.insert({ key.get(), value.get() }); lua_pop(state, 1); // we remove the value but keep the key for the next iteration } catch(...) {