From: Gabriel Corona Date: Thu, 9 Oct 2014 13:59:29 +0000 (+0200) Subject: [mc] Fix segfault when a function does not have a name X-Git-Tag: v3_12~760^2~74^2 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/324e226f2c02c8212eda615f9e54f640a56f961e [mc] Fix segfault when a function does not have a name This happens when compiling with LLVM (clang/dragonegg). --- diff --git a/src/mc/mc_ignore.c b/src/mc/mc_ignore.c index 480a74b2a3..8ee35e5d8c 100644 --- a/src/mc/mc_ignore.c +++ b/src/mc/mc_ignore.c @@ -224,7 +224,8 @@ static void mc_ignore_local_variable_in_scope(const char *var_name, // Processing of direct variables: // If the current subprogram matche the given name: - if (subprogram_name == NULL || strcmp(subprogram_name, subprogram->name) == 0) { + if (!subprogram_name || + subprogram->name && strcmp(subprogram_name, subprogram->name) == 0) { // Try to find the variable and remove it: int start = 0;