]> git.sesse.net Git - stockfish/commitdiff
Fix broken last patch series
authorMarco Costalba <mcostalba@gmail.com>
Tue, 28 Dec 2010 09:16:53 +0000 (10:16 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Tue, 28 Dec 2010 12:01:14 +0000 (13:01 +0100)
When a reference breaks things !

Here we take a reference (that is a pointer) to an
entry in a vector that changes below us --> BOOM !

References are essential but should be considered with
care in C++ because could lead to nasty surprises.

Restored functionality.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp

index fdad3e51d50f9183c378f1aa1ded6205aa52d426..6678b32d5c39f58d88a97ce670c00d14acab0f8b 100644 (file)
@@ -2744,7 +2744,7 @@ split_point_start: // At split points actual search starts from here
 
     for (i = 1; i <= n; i++)
     {
-        const RootMove& rm = this->at(i);
+        const RootMove rm = this->at(i);
         for (j = i; j > 0 && this->at(j - 1) < rm; j--)
             (*this)[j] = this->at(j - 1);