From: Rodrigo Kumpera Date: Thu, 11 May 2017 23:27:51 +0000 (-0700) Subject: [jit] Fix mono_debug_count breakage introduced by the g_getenv change. X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=414b5fc644332b4991320e5627600f418339a7a5;p=mono.git [jit] Fix mono_debug_count breakage introduced by the g_getenv change. --- diff --git a/mono/mini/mini-runtime.c b/mono/mini/mini-runtime.c index b5d79629a54..33b95a61779 100644 --- a/mono/mini/mini-runtime.c +++ b/mono/mini/mini-runtime.c @@ -583,23 +583,23 @@ break_count (void) G_GNUC_UNUSED gboolean mono_debug_count (void) { - static int count = 0; + static int count = 0, int_val = 0; static gboolean inited; - static char *value; count ++; if (!inited) { - value = g_getenv ("COUNT"); + char *value = g_getenv ("COUNT"); + if (value) { + int_val = atoi (value); + g_free (value); + } inited = TRUE; } - if (!value) + if (!int_val) return TRUE; - int int_val = atoi (value); - g_free (value); - if (count == int_val) break_count ();