From: suter Date: Tue, 26 Jun 2012 09:00:05 +0000 (+0200) Subject: When you detect a cycle in a structure supposed to be acyclic, don't X-Git-Tag: v3_8~461 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c17cff7f61f54f1370a7572c8be6d8b4f43c5591 When you detect a cycle in a structure supposed to be acyclic, don't return it the user. Raise an error message and return nothing instead. --- diff --git a/src/simdag/sd_daxloader.c b/src/simdag/sd_daxloader.c index 40b4e6298e..2bbd2c753f 100644 --- a/src/simdag/sd_daxloader.c +++ b/src/simdag/sd_daxloader.c @@ -384,8 +384,16 @@ xbt_dynar_t SD_daxload(const char *filename) } } - acyclic_graph_detail(result); - return result; + if (!acyclic_graph_detail(result)){ + XBT_ERROR("The DAX described in %s is not a DAG. It contains a cycle.", + filename); + xbt_dynar_foreach(result, cpt, file) + SD_task_destroy(file); + xbt_dynar_free_container(&result); + return NULL; + } else { + return result; + } } void STag_dax__adag(void)