]> git.ipfire.org Git - thirdparty/haproxy.git/commit
CLEANUP: hlua: simplify ambiguous lua_insert() usage in hlua_ctx_resume()
authorAurelien DARRAGON <adarragon@haproxy.com>
Tue, 4 Jun 2024 13:52:23 +0000 (15:52 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Tue, 4 Jun 2024 14:31:38 +0000 (16:31 +0200)
commit2bde0d64ddf0e32257444f14e69adea8f899b74b
tree8ad9dcbb9c9d9798a4d8aa5629587af45beffe05
parent755c2daf0f88885fd6825c55ae59198726c4905e
CLEANUP: hlua: simplify ambiguous lua_insert() usage in hlua_ctx_resume()

'lua_insert(lua->T, -lua_gettop(lua->T))' is actually used to rotate the
top value with the bottom one, thus the code was overkill and the comment
was actually misleading, let's fix that by using explicit equivalent form
(absolute index).

It may be backported with 5508db9a2 ("BUG/MINOR: hlua: fix unsafe
lua_tostring() usage with empty stack") to all stable versions to ease
code maintenance.
src/hlua.c