Avoid underflows in 'luaF_getlocalname'

A call like 'debug.getlocal(test, -2147483648)' could decrement
-2147483648, causing an underflow. (As this happens in a debug function,
the fix was not strictly necessary, but it has no cost in the generated
code.)
This commit is contained in:
Roberto I
2026-10-12 16:12:40 -03:00
parent 745b96db54
commit 80f3ecc44f
5 changed files with 8 additions and 7 deletions
+1
View File
@@ -258,6 +258,7 @@ print'+'
-- invalid levels in [gs]etlocal
assert(not pcall(debug.getlocal, 20, 1))
assert(not pcall(debug.setlocal, -1, 1, 10))
assert(not debug.getlocal(test, -2147483648))
-- parameter names