gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] crash fix


From: Arend Bayer
Subject: [gnugo-devel] crash fix
Date: Sat, 31 Jul 2004 23:51:00 +0200 (CEST)


- move clearing of ..._vital_points to initalize_dragon_data()

I believe this fixes the crashes Matthias reported. I also got one, and it
happened at the empty board when starting a new game. Since the crash is
awkward to reproduce, I haven't tested whether this fixes it, though.

Arend


Index: engine/dragon.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/dragon.c,v
retrieving revision 1.141
diff -u -p -r1.141 dragon.c
--- engine/dragon.c     19 Jul 2004 12:23:08 -0000      1.141
+++ engine/dragon.c     31 Jul 2004 21:31:17 -0000
@@ -557,8 +557,6 @@ static void
 eye_computations()
 { 
   int str;
-  memset(black_vital_points, 0, BOARDMAX * sizeof(struct vital_eye_points));
-  memset(white_vital_points, 0, BOARDMAX * sizeof(struct vital_eye_points));
 
   for (str = BOARDMIN; str < BOARDMAX; str++) {
     if (!ON_BOARD(str))
@@ -731,6 +729,9 @@ initialize_dragon_data(void)
    * reach initialize_supplementary_dragon_data().
    */
   number_of_dragons = 0;
+
+  memset(black_vital_points, 0, BOARDMAX * sizeof(struct vital_eye_points));
+  memset(white_vital_points, 0, BOARDMAX * sizeof(struct vital_eye_points));
 }
 
 




reply via email to

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