aboutsummaryrefslogtreecommitdiff
path: root/nestedvm.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2023-03-12 14:11:34 +0000
committerSimon Tatham <anakin@pobox.com>2023-03-12 14:24:19 +0000
commitf018ef97d34b9126744e63cc2112c302fcae4ab4 (patch)
treef403e3d8126e6d51525db907be63e91676e079bf /nestedvm.c
parent08009f3949b5cf6edfd36e904dd8abadb19dd7ba (diff)
downloadpuzzles-f018ef97d34b9126744e63cc2112c302fcae4ab4.zip
puzzles-f018ef97d34b9126744e63cc2112c302fcae4ab4.tar.gz
puzzles-f018ef97d34b9126744e63cc2112c302fcae4ab4.tar.bz2
puzzles-f018ef97d34b9126744e63cc2112c302fcae4ab4.tar.xz
Galaxies: fix recursion depth limit in solver.
The static variable 'solver_recurse_depth' is _mostly_ used by the standalone solver, to appropriately indent the solver diagnostics for the current recursion level. So most uses of it are guarded by an '#ifdef STANDALONE_SOLVER' statement, or some equivalent (such as being inside the solvep() macro). One exception is the check that limits the recursion depth to 5, to avoid getting hung up forever on a too-hard game. Unfortunately, this check depends on the variable actually incrementing when we recurse another level - and it wasn't, because the increment itself was under ifdef! So the generator in live Galaxies could recurse arbitrarily deep, and generate puzzles that the standalone solver found too hard _even_ at Unreasonable mode. Removed the ifdefs, so that solver_recurse_depth is now incremented and decremented. Also, make sure to initialise the depth to 0 at the start of a solver run, just in case it had a bogus value left over from a previous run.
Diffstat (limited to 'nestedvm.c')
0 files changed, 0 insertions, 0 deletions