[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gnugo-devel] bug report
From: |
Gunnar Farnebäck |
Subject: |
Re: [gnugo-devel] bug report |
Date: |
Thu, 07 Jul 2011 22:54:56 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110626 Icedove/3.1.11 |
On 07/04/11 13:19, Hendrik Baier wrote:
***assertion failure:
board.c:1173 - board[pos] == EMPTY near C2***
[...]
Thanks for the report. I can reproduce the crash and have made a patch
to fix it, appended below. It can also be found at
http://trac.gnugo.org/gnugo/ticket/229
/Gunnar
diff --git a/patterns/helpers.c b/patterns/helpers.c
index 9381a61..5e5a0b2 100644
--- a/patterns/helpers.c
+++ b/patterns/helpers.c
@@ -502,18 +502,27 @@ backfill_helper(int apos, int bpos, int cpos)
int color = board[cpos];
int other = OTHER_COLOR(color);
int dpos = NO_MOVE;
+ int move_found = 0;
if (TRYMOVE(apos, color)) {
if (TRYMOVE(bpos, other)) {
if (attack(cpos, NULL) && find_defense(cpos, &dpos)) {
- set_minimum_move_value(dpos, 0.1);
- TRACE("%o...setting min move value of %1m to 0.1\n", dpos);
+ move_found = 1;
}
popgo();
}
popgo();
}
+ /* It might happen that the tried moves changed the board
+ * significantly. Verify that dpos is playable also without those
+ * moves.
+ */
+ if (move_found && board[dpos] == EMPTY && is_legal(dpos, color)) {
+ set_minimum_move_value(dpos, 0.1);
+ TRACE("%o...setting min move value of %1m to 0.1\n", dpos);
+ }
+
return 0;
}