gnugo-devel
[Top][All Lists]
Advanced

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

Re: [gnugo-devel] Another array bound violation 3.1.10


From: Gunnar Farneback
Subject: Re: [gnugo-devel] Another array bound violation 3.1.10
Date: Tue, 16 Oct 2001 22:28:01 +0200
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)

Teun wrote:
> This patch adds an assertion to include_eyepoint.
> It is triggered when life.tst test 1001 is run.

The life code is currently unused, except in the life.tst regression
test suite, and its future is uncertain. Thus this is no priority bug
to fix. Rather than having the test suite crash, I've modified the
patch with a quick and dirty workaround. If someone ever decides to
get the life code up to shape, this needs to be properly fixed, but
for now this will suffice.

I've added the modified patch found below to CVS.

/Gunnar

Index: life.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/life.c,v
retrieving revision 1.9
diff -u -r1.9 life.c
--- life.c      2001/10/16 19:53:01     1.9
+++ life.c      2001/10/16 20:24:16
@@ -314,6 +314,17 @@
 include_eyepoint(int i, int j, int proper, int restrictions)
 {
   if (eyeindex[i][j] == -1) {
+    /* FIXME: This is only a temporary workaround to avoid a crash in
+     * the assertion below.
+     */
+    if (eyesize > MAX_EYE_SIZE)
+      return;
+    /* FIXME:
+     * Should this be < MAX_EYE_SIZE?
+     * The list of eyes in eyei, eyej is ended
+     * with (-1, -1)
+     */
+    ASSERT2(eyesize <= MAX_EYE_SIZE, i, j);
     eyeindex[i][j] = eyesize;
     eyei[eyesize] = i;
     eyej[eyesize] = j;



reply via email to

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