X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/25137bd6bc44e1260223b141b46cedd6e7ef1da0..3eef4e948ebd9b1d8c9d26a6dedd535109856554:/src/surf/surf_routing.c diff --git a/src/surf/surf_routing.c b/src/surf/surf_routing.c index e013c5c102..9adc4541ab 100644 --- a/src/surf/surf_routing.c +++ b/src/surf/surf_routing.c @@ -610,14 +610,14 @@ 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) { + if (index_src >= ELEMENTS_FATHER_MAXDEPTH) + xbt_die("ELEMENTS_FATHER_MAXDEPTH should be increased for path_src"); path_src[index_src++] = current; - xbt_assert(index_src <= ELEMENTS_FATHER_MAXDEPTH, - "ELEMENTS_FATHER_MAXDEPTH should be increased for path_src"); } for (current = dst_as ; current != NULL ; current = current->routing_father) { + if (index_dst >= ELEMENTS_FATHER_MAXDEPTH) + xbt_die("ELEMENTS_FATHER_MAXDEPTH should be increased for path_dst"); path_dst[index_dst++] = current; - xbt_assert(index_dst <= ELEMENTS_FATHER_MAXDEPTH, - "ELEMENTS_FATHER_MAXDEPTH should be increased for path_dst"); } /* (3) find the common father */ @@ -1179,9 +1179,8 @@ route_extended_t generic_get_bypassroute(routing_component_t rc, current_src = xbt_dynar_get_ptr(path_src, index_src); current_dst = xbt_dynar_get_ptr(path_dst, index_dst); while (index_src >= 0 && index_dst >= 0 && *current_src == *current_dst) { - routing_component_t *tmp_src, *tmp_dst; - tmp_src = xbt_dynar_pop_ptr(path_src); - tmp_dst = xbt_dynar_pop_ptr(path_dst); + xbt_dynar_pop_ptr(path_src); + xbt_dynar_pop_ptr(path_dst); index_src--; index_dst--; current_src = xbt_dynar_get_ptr(path_src, index_src);