Commit f9047e7
committed
Fixed #35 - fixed crash in tactical benchmark.
The tactical benchmark could crash due to accessing
invalid chess move in ChessBoard::NumberOfRepetitions().
That function tries to repeat making moves on the board,
but the "moves" are not always valid chess moves.
NumberOfRepetitions() already had a safety check to
make sure the board was not edited before doing anything.
The safety check did not work in the case of the benchmark
because the benchmark didn't set an initial FEN
(Forsyth Edwards Notation) string. A non-null FEN string
is required to indicate that a position has been edited.
The fix was to make sure the benchmark initializes
the FEN string for the starting position before
doing each min-max search.1 parent 6f5a19d commit f9047e7
3 files changed
+21
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1487 | 1487 | | |
1488 | 1488 | | |
1489 | 1489 | | |
1490 | | - | |
1491 | | - | |
1492 | | - | |
1493 | | - | |
1494 | | - | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
1495 | 1503 | | |
1496 | | - | |
1497 | | - | |
1498 | | - | |
| 1504 | + | |
1499 | 1505 | | |
1500 | 1506 | | |
1501 | 1507 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1278 | 1278 | | |
1279 | 1279 | | |
1280 | 1280 | | |
1281 | | - | |
| 1281 | + | |
| 1282 | + | |
1282 | 1283 | | |
1283 | 1284 | | |
1284 | 1285 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2158 | 2158 | | |
2159 | 2159 | | |
2160 | 2160 | | |
| 2161 | + | |
2161 | 2162 | | |
2162 | 2163 | | |
2163 | 2164 | | |
| |||
2180 | 2181 | | |
2181 | 2182 | | |
2182 | 2183 | | |
| 2184 | + | |
2183 | 2185 | | |
2184 | 2186 | | |
2185 | 2187 | | |
| |||
2210 | 2212 | | |
2211 | 2213 | | |
2212 | 2214 | | |
| 2215 | + | |
2213 | 2216 | | |
2214 | 2217 | | |
2215 | 2218 | | |
| |||
2248 | 2251 | | |
2249 | 2252 | | |
2250 | 2253 | | |
| 2254 | + | |
2251 | 2255 | | |
2252 | 2256 | | |
2253 | 2257 | | |
| |||
2292 | 2296 | | |
2293 | 2297 | | |
2294 | 2298 | | |
| 2299 | + | |
2295 | 2300 | | |
2296 | 2301 | | |
2297 | 2302 | | |
| |||
0 commit comments