[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnugo-devel] Bug in 3.7.2 --score estimate
From: |
Eric Backus |
Subject: |
[gnugo-devel] Bug in 3.7.2 --score estimate |
Date: |
Sun, 13 Mar 2005 14:18:36 -0800 |
User-agent: |
KMail/1.6.2 |
I've been using gnugo to help improve my go skills, and I find it very
helpful. Thank you for making this available. I decided to try development
version 3.7.2, and found a problem with:
gnugo --score estimate -l anygame.sgf
This gives me a segmentation fault. I tried the latest CVS version and got
the same thing. Not that it matters, but this is on a relatively unmodified
SuSE 9.1 Linux system, with gnugo compiled with gcc 3.3.3.
So I tracked the problem down, and found that sometimes gnugo_estimate_score
is called with NULL arguments, but the function doesn't test for that.
Here's a trivial patch which fixes the problem:
--- engine/interface.c.orig 2005-01-06 11:50:27.000000000 -0800
+++ engine/interface.c 2005-03-12 23:45:10.000000000 -0800
@@ -353,8 +353,10 @@
gnugo_estimate_score(float *upper, float *lower)
{
silent_examine_position(EXAMINE_DRAGONS);
- *upper = white_score;
- *lower = black_score;
+ if (upper != NULL)
+ *upper = white_score;
+ if (lower != NULL)
+ *lower = black_score;
return ((white_score + black_score)/2.0);
}
--
Eric Backus <address@hidden>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnugo-devel] Bug in 3.7.2 --score estimate,
Eric Backus <=