From 99b5293909074fc0bc2348bd719990b91baa365d Mon Sep 17 00:00:00 2001 From: cristianrosa Date: Mon, 6 Dec 2010 14:54:14 +0000 Subject: [PATCH 1/1] Bugfix: protect SIMIX_context_self() in the case that SIMIX is not initialized. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9018 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/simix/private.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/simix/private.h b/src/simix/private.h index 9095077e3c..e3fc539264 100644 --- a/src/simix/private.h +++ b/src/simix/private.h @@ -238,11 +238,11 @@ static XBT_INLINE void SIMIX_context_runall(xbt_swag_t processes) */ static XBT_INLINE smx_context_t SIMIX_context_self(void) { - if (simix_global->context_factory == NULL) { - return NULL; + if (simix_global && simix_global->context_factory != NULL) { + return (*(simix_global->context_factory->self))(); } - return (*(simix_global->context_factory->self))(); + return NULL; } /** -- 2.20.1