From c17cff7f61f54f1370a7572c8be6d8b4f43c5591 Mon Sep 17 00:00:00 2001 From: suter Date: Tue, 26 Jun 2012 11:00:05 +0200 Subject: [PATCH] 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. --- src/simdag/sd_daxloader.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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) -- 2.20.1