From 66ff943ab8bb2b33f5627ec27f1d8d85a29ec251 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Fri, 27 Sep 2013 09:37:45 +0200 Subject: [PATCH] Fix mini-Shogi out-of-bounds acces of board --- gnushogi/eval.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/gnushogi/eval.c b/gnushogi/eval.c index b0ae6c1..569b997 100644 --- a/gnushogi/eval.c +++ b/gnushogi/eval.c @@ -1354,6 +1354,12 @@ PawnValue(short sq, short side) if (in_opening_stage) { +#ifndef MINISHOGI +/* FIXME: [HGM] The 3rd-rank Pawn section is meaningless in mini-Shogi, + * (which does not have opposing Pawns), and can do out-of-bound access, + * as the promotion zone is only 1 rank, so Pawns can be closer than 3 ranks + * to the board edge. + */ if (crow(c1, sq) == 2) /* pawn on 3d rank */ { if (board[(c1 == black) ? @@ -1383,7 +1389,6 @@ PawnValue(short sq, short side) } } -#ifndef MINISHOGI /* FIXME: calculations below are wrong for minishogi, all done for 9x9 * board - and anyway we don't know the stage really :) */ -- 1.7.0.4