[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gnugo-devel] A problem in atari_atari
From: |
Trevor Morris |
Subject: |
Re: [gnugo-devel] A problem in atari_atari |
Date: |
Wed, 12 Dec 2001 13:47:53 -0500 |
>The stone at B1 should not be classified as critical
>and I'll have to fix this in the semeai code. However
>it still seems to me that there will be a potential
>for a crash at line 641 of combination.c in error
>situations. Probably str should be tested for
>emptiness and if this happens the conservative conclusion
>would be to conclude that there is no combination.
>
>Thus I propose the following. This includes the previous
>patch.
Shouldn't there be a warning message issued to stderr, if not
an assert, as this should never happen?
>Dan
>
>
>Index: engine/combination.c
>===================================================================
>RCS file: /cvsroot/gnugo/gnugo/engine/combination.c,v
>retrieving revision 1.10
>diff -u -r1.10 combination.c
>--- engine/combination.c 5 Dec 2001 19:49:20 -0000 1.10
>+++ engine/combination.c 12 Dec 2001 18:24:31 -0000
>@@ -637,6 +637,12 @@
> if (!trymove(apos, color, "do_atari_atari-A", str, EMPTY, NO_MOVE))
> continue;
>
>+ if (!IS_STONE(str)) {
>+ /* Error situation */
>+ popgo();
>+ return 0;
>+ }
>+
> /* Try to defend the stone (str) which is threatened. */
> aa_val = countstones(str);
>
>Index: engine/reading.c
>===================================================================
>RCS file: /cvsroot/gnugo/gnugo/engine/reading.c,v
>retrieving revision 1.38
>diff -u -r1.38 reading.c
>--- engine/reading.c 10 Dec 2001 17:22:40 -0000 1.38
>+++ engine/reading.c 12 Dec 2001 18:25:21 -0000
>@@ -895,12 +895,10 @@
>
> for (r = -1; r < max_points; r++) {
> /* -1 is used only when stackp > 0. */
>- if (stackp > 0) {
>- if (r == -1)
>- bb = dd;
>- else
>- break;
>- }
>+ if (r == -1 && stackp > 0)
>+ break;
>+ if (r == -1)
>+ bb = dd;
> else {
> if (worm[adjs[k]].defend_codes[r] == 0)
> break;
>
>
>
>_______________________________________________
>gnugo-devel mailing list
>address@hidden
>http://mail.gnu.org/mailman/listinfo/gnugo-devel
>