Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Bugfix: Protect SIMIX_process_self in the case that the context module is not yet...
[simgrid.git] / src / simix / smx_process.c
index ee203f4..f22b2cc 100644 (file)
@@ -25,10 +25,9 @@ static unsigned long simix_process_count = 0;
  */
 XBT_INLINE smx_process_t SIMIX_process_self(void)
 {
-  if (simix_global)
-    return SIMIX_context_get_data(SIMIX_context_self());
+  smx_context_t self_context = SIMIX_context_self();
 
-  return NULL;
+  return self_context ? SIMIX_context_get_data(self_context) : NULL;
 }
 
 /**