diff options
author | vadim-xd <vadim-xd@yandex-team.com> | 2025-05-11 23:11:53 +0300 |
---|---|---|
committer | vadim-xd <vadim-xd@yandex-team.com> | 2025-05-11 23:27:21 +0300 |
commit | d94630d2ef412433360d582e7d941ff9aa96d2e8 (patch) | |
tree | b4fce6556b8ce7d6c7abad8a769e542fac6fb2df /library/cpp/lua | |
parent | 26d7514b035a86c73cbf37d0b2f7d069027d3605 (diff) | |
download | ydb-d94630d2ef412433360d582e7d941ff9aa96d2e8.tar.gz |
Enable lua_assert in debug builds
commit_hash:ea00901b57ccbf77add24fe9e28634acf1ba557c
Diffstat (limited to 'library/cpp/lua')
-rw-r--r-- | library/cpp/lua/wrapper.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/library/cpp/lua/wrapper.h b/library/cpp/lua/wrapper.h index 0d568f049ad..97280b9f0d5 100644 --- a/library/cpp/lua/wrapper.h +++ b/library/cpp/lua/wrapper.h @@ -396,6 +396,10 @@ public: } inline void call(int args, int rets) { + Y_ASSUME(args >= 0); // Allows to optimize out comparison with LUA_MULTRET if it's negative (-1 in Lua 5.2-5.4) + if (rets != LUA_MULTRET && rets > args) { + ensure_stack(rets - args); + } if (lua_pcall(State_, args, rets, 0)) { error(); } |