Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix stupid off-by-one error, and make check survive to NDEBUG.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Tue, 17 May 2011 19:28:12 +0000 (21:28 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Tue, 17 May 2011 19:28:31 +0000 (21:28 +0200)
src/surf/surf_routing.c

index e013c5c..60b1291 100644 (file)
@@ -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 */