mirror of
https://github.com/lua/lua.git
synced 2026-10-26 18:45:25 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user