Closed edre closed 1 year ago
Hm, interesting. This suggests that state.winning_action
isn't properly getting set here. A state that can lead to a state with a win shouldn't get past the winning_action
check at the beginning of iterate
.
Ultimately, I'd rather fix that source issue than modifying iterate to handle states with winning results. Let me see what I can find...
Do you happen to have a state that causes bestmove
to crash?
It's probably better to fix the bug at the source. This patch is more of a hack to demonstrate where the problem manifests.
Previously this would miss some winning positions, then Node_expand on a state with no actions, and cause a read out of bounds on the empty actions list, then segfault.
Fixes #16.