Skip to content

Commit

Permalink
Set the cstacklimit for 5.4.0 / 5.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCycoONE committed Oct 27, 2020
1 parent 50d7445 commit b4d0519
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions .luacheckrc
Expand Up @@ -240,3 +240,4 @@ add_ignore("CorsixTH/Lua/world.lua", "212")
add_ignore("CorsixTH/Lua/world.lua", "542")
add_ignore("CorsixTH/Luatest/non_strict.lua", "212")
add_ignore("CorsixTH/Luatest/spec/utility_spec.lua", "121")
add_ignore("CorsixTH/CorsixTH.lua", "143") -- luacheck is missing 5.4 debug functions
6 changes: 6 additions & 0 deletions CorsixTH/CorsixTH.lua
Expand Up @@ -9,6 +9,12 @@ if (package and package.preload and package.preload.TH) == nil then
error "This file must be invoked by the CorsixTH executable"
end

-- Set a large enough cstacklimit to load complex saves in stack based
-- versions of lua, such as 5.4.[01]
if debug.setcstacklimit then
debug.setcstacklimit(30000)
end

-- Parse script parameters:
local run_debugger = false
for _, arg in ipairs({...}) do
Expand Down

0 comments on commit b4d0519

Please sign in to comment.