From 4b930ad2b7b6f47513af3a95bc18ef92c05a7d1c Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Tue, 17 May 2011 21:28:12 +0200 Subject: [PATCH] Fix stupid off-by-one error, and make check survive to NDEBUG. --- src/surf/surf_routing.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/surf/surf_routing.c b/src/surf/surf_routing.c index e013c5c102..60b12918fa 100644 --- a/src/surf/surf_routing.c +++ b/src/surf/surf_routing.c @@ -611,13 +611,13 @@ static void elements_father(const char *src, const char *dst, /* (2) find the path to the root routing component */ for (current = src_as ; current != NULL ; current = current->routing_father) { path_src[index_src++] = current; - xbt_assert(index_src <= ELEMENTS_FATHER_MAXDEPTH, - "ELEMENTS_FATHER_MAXDEPTH should be increased for path_src"); + if (index_src >= ELEMENTS_FATHER_MAXDEPTH) + xbt_die("ELEMENTS_FATHER_MAXDEPTH should be increased for path_src"); } for (current = dst_as ; current != NULL ; current = current->routing_father) { path_dst[index_dst++] = current; - xbt_assert(index_dst <= ELEMENTS_FATHER_MAXDEPTH, - "ELEMENTS_FATHER_MAXDEPTH should be increased for path_dst"); + if (index_dst >= ELEMENTS_FATHER_MAXDEPTH) + xbt_die("ELEMENTS_FATHER_MAXDEPTH should be increased for path_dst"); } /* (3) find the common father */ -- 2.20.1