gnugo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gnugo-devel] Crash!


From: Gunnar Farneback
Subject: Re: [gnugo-devel] Crash!
Date: Tue, 01 Jan 2002 15:47:46 +0100
User-agent: EMH/1.14.1 SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.3 Emacs/20.7 (sparc-sun-solaris2.7) (with unibyte mode)

Dan wrote:
> The following file causes a crash in current versions.
> The double ko around B4 confuses atari_atari_confirm_safety.

This crash and another (unrelated) one on NNGS are fixed by the patch
below.

/Gunnar

Index: engine/combination.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/combination.c,v
retrieving revision 1.14
diff -u -r1.14 combination.c
--- engine/combination.c        20 Dec 2001 21:09:43 -0000      1.14
+++ engine/combination.c        1 Jan 2002 14:45:48 -0000
@@ -973,7 +973,7 @@
       x += m;
       y += n;
 
-      str = worm[POS(x, y)].origin;
+      str = find_origin(POS(x, y));
 
       if (current_minsize > 0
          && countstones(str) < current_minsize
@@ -1059,6 +1059,10 @@
   for (r = 0; r < AA_MAX_TARGETS_PER_MOVE && targets[r] != NO_MOVE; r++) {
     int str = targets[r];
 
+    /* If the attack move happened to remove (str), there's no defense. */
+    if (board[str] == EMPTY)
+      continue;
+    
     /* Because we know (str) is threatened there is an
      * attack and we can be sure find_defense() will give a
      * useful defense point if it returns non-zero. Usually we



reply via email to

[Prev in Thread] Current Thread [Next in Thread]