From 1a867155fd80328dfa6425cedfca3f4b81d4129a Mon Sep 17 00:00:00 2001 From: cristianrosa Date: Mon, 6 Dec 2010 14:54:09 +0000 Subject: [PATCH] Bugfix: Protect SIMIX_process_self in the case that the context module is not yet initialized. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9016 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/simix/smx_process.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/simix/smx_process.c b/src/simix/smx_process.c index ee203f4dd3..f22b2ccf72 100644 --- a/src/simix/smx_process.c +++ b/src/simix/smx_process.c @@ -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; } /** -- 2.20.1