From 9e900ac21ff6a775f763e30fe904541742deb290 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Tue, 29 Mar 2022 18:09:28 +0200 Subject: [PATCH] LuaWrapper: Prevent referencing a temporary object Reported by Coverity (CIDs 120403 and 145915) --- ext/luawrapper/include/LuaContext.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/luawrapper/include/LuaContext.hpp b/ext/luawrapper/include/LuaContext.hpp index e3a87ee9b7..9f8d473fb7 100644 --- a/ext/luawrapper/include/LuaContext.hpp +++ b/ext/luawrapper/include/LuaContext.hpp @@ -1770,7 +1770,8 @@ private: -> typename std::enable_if::value, TRetValue>::type { if (index >= 0) { - Binder binder{ callback, {} }; + static const TFirstType empty{}; + Binder binder{ callback, empty }; return readIntoFunction(state, retValueTag, binder, index + 1, othersTags...); } -- 2.47.2