From 45594865637a4be4e8a4f1604c819b3bb0fb07e4 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Mon, 30 May 2011 15:57:05 +0200 Subject: [PATCH] ucb1amaf_update criticality stats: Fix invalid memory access on pass --- uct/policy/ucb1amaf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uct/policy/ucb1amaf.c b/uct/policy/ucb1amaf.c index c81dda3..8ede363 100644 --- a/uct/policy/ucb1amaf.c +++ b/uct/policy/ucb1amaf.c @@ -193,7 +193,7 @@ ucb1amaf_update(struct uct_policy *p, struct tree *tree, struct tree_node *node, if (node->parent == NULL) assert(tree->root_color == stone_other(child_color)); - if (!b->crit_amaf) { + if (!b->crit_amaf && !is_pass(node->coord)) { stats_add_result(&node->winner_owner, board_at(final_board, node->coord) == winner_color ? 1.0 : 0.0, 1); stats_add_result(&node->black_owner, board_at(final_board, node->coord) == S_BLACK ? 1.0 : 0.0, 1); } @@ -230,7 +230,7 @@ ucb1amaf_update(struct uct_policy *p, struct tree *tree, struct tree_node *node, * to record the result unmodified; in that case, * we will correctly negate them at the descend phase. */ - if (b->crit_amaf) { + if (b->crit_amaf && !is_pass(node->coord)) { stats_add_result(&ni->winner_owner, board_at(final_board, ni->coord) == winner_color ? 1.0 : 0.0, 1); stats_add_result(&ni->black_owner, board_at(final_board, ni->coord) == S_BLACK ? 1.0 : 0.0, 1); } -- 2.11.4.GIT