projects
/
stockfish
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
027ba27
)
Prevent infinite loops on repetitions.
author
Steinar H. Gunderson
<sgunderson@bigfoot.com>
Sat, 19 Mar 2016 21:22:40 +0000
(22:22 +0100)
committer
Steinar H. Gunderson
<sgunderson@bigfoot.com>
Sat, 24 Nov 2018 10:17:41 +0000
(11:17 +0100)
src/main.cpp
patch
|
blob
|
history
diff --git
a/src/main.cpp
b/src/main.cpp
index 4be9aaf3fac5727e1db8833d8acbab4d4929275c..299b4135c8e351fa8be5895cb64d2173ec655484 100644
(file)
--- a/
src/main.cpp
+++ b/
src/main.cpp
@@
-114,9
+114,12
@@
public:
// Follow the PV until we hit an illegal move.
std::stack<Move> pv;
+ std::set<Key> seen;
while (found && is_ok(entry->move())) {
FillMove(entry->move(), response->add_pv());
+ if (seen.count(pos->key())) break;
pv.push(entry->move());
+ seen.insert(pos->key());
setup_states->push(StateInfo());
pos->do_move(entry->move(), setup_states->top(), pos->gives_check(entry->move(), CheckInfo(*pos)));
entry = TT.probe(pos->key(), found);