From ccf4ac6b44a378d8f0e32b8186fdc4d3b25c3bda Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Fri, 25 Jul 2025 12:48:27 +0200 Subject: Fix crashes in MSVC release builds related to KeeperOperationInProgress * scope the KeeperOperationInProgress object on linda calls * but since it's not enough, just comment it, it is only debug stuff anyway --- src/lanes.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/lanes.cpp') diff --git a/src/lanes.cpp b/src/lanes.cpp index d9ac4df..4373aee 100644 --- a/src/lanes.cpp +++ b/src/lanes.cpp @@ -178,9 +178,13 @@ LUAG_FUNC(sleep) } else if (lua_isnoneornil(L_, 1)) { lua_pushnumber(L_, 0); // L_: duration? receive() timerLinda 0 } else if (!lua_isnumber(L_, 1)) { - raise_luaL_argerror(L_, StackIndex{ 1 }, "invalid duration"); + raise_luaL_argerror(L_, StackIndex{ 1 }, "duration must be a number"); } else { + auto const _n{ lua_tonumber(L_, 1) }; + if (_n < 0) { + raise_luaL_argerror(L_, StackIndex{ 1 }, "duration must be >= 0"); + } lua_pushnumber(L_, lua_tonumber(L_, 1)); // L_: duration? receive() timerLinda duration } luaW_pushstring(L_, "ac100de1-a696-4619-b2f0-a26de9d58ab8"); // L_: duration? receive() timerLinda duration key -- cgit v1.2.3-55-g6feb