mirror of
https://github.com/neovim/neovim
synced 2025-07-19 18:51:46 +00:00
fix(vim.system): invalid MAX_TIMEOUT for 32-bit systems #31638
The maximum signed value on 32-bit systems is 2 ^ 31 - 1. When using 2 ^ 31 for
the default timeout, the value would overflow on such systems resulting in
a negative value, which caused a stack trace when calling wait() without
a timeout.
(cherry picked from commit 4e130c1ee4
)
This commit is contained in:
committed by
github-actions[bot]
parent
bf66871113
commit
1a030f6e04
@ -88,7 +88,8 @@ function SystemObj:_timeout(signal)
|
|||||||
self:kill(signal or SIG.TERM)
|
self:kill(signal or SIG.TERM)
|
||||||
end
|
end
|
||||||
|
|
||||||
local MAX_TIMEOUT = 2 ^ 31
|
-- Use max 32-bit signed int value to avoid overflow on 32-bit systems. #31633
|
||||||
|
local MAX_TIMEOUT = 2 ^ 31 - 1
|
||||||
|
|
||||||
--- @param timeout? integer
|
--- @param timeout? integer
|
||||||
--- @return vim.SystemCompleted
|
--- @return vim.SystemCompleted
|
||||||
|
Reference in New Issue
Block a user