Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Change an assert to an exception raising point (to ease debugging)
[simgrid.git] / src / gras / Virtu / process.c
index e61fa71..462c34e 100644 (file)
@@ -10,7 +10,6 @@
 #include "xbt/ex.h"
 #include "xbt/sysdep.h"
 #include "xbt/log.h"
-#include "xbt/error.h"
 #include "gras/transport.h"
 #include "gras/datadesc.h"
 #include "gras/messages.h"
@@ -72,7 +71,7 @@ void gras_userdata_set(void *ud) {
 
 void *gras_libdata_get(const char *name) {
   gras_procdata_t *pd=gras_procdata_get();
-  void *res;
+  void *res=NULL;
   xbt_ex_t e;
    
   TRY {
@@ -108,8 +107,8 @@ gras_procdata_init() {
     } CATCH(e) {
       xbt_ex_free(e);
     }
-    xbt_assert1(!found,
-               "MayDay: two modules use '%s' as libdata name", fab.name);
+    if (found)
+      THROW1(unknown_error,0,"MayDay: two modules use '%s' as libdata name", fab.name);
     
     /* Add the data in place */
     xbt_dict_set(pd->libdata, fab.name, (fab.creator)(), fab.destructor);