From e94887a18ce1c0e0b6d240bd111a15ada01982d8 Mon Sep 17 00:00:00 2001 From: Jay Krell Date: Thu, 13 Jun 2019 01:41:30 -0700 Subject: [PATCH] threads.c:6403:6: warning: 'current_idx' may be used uninitialized in this function [-Wmaybe-uninitialized] if (i == current_idx) ^ threads.c:6549:6: note: 'current_idx' was declared here int current_idx; ^~~~~~~~~~~ --- mono/metadata/threads.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mono/metadata/threads.c b/mono/metadata/threads.c index 913f01ea458..c509fb95752 100644 --- a/mono/metadata/threads.c +++ b/mono/metadata/threads.c @@ -6373,6 +6373,7 @@ summarizer_supervisor_end (SummarizerSupervisorState *state) static gboolean summarizer_state_init (SummarizerGlobalState *state, MonoNativeThreadId current, int *my_index) { + *my_index = 0; gint32 started_state = mono_atomic_cas_i32 (&state->has_owner, 1 /* set */, 0 /* compare */); gboolean not_started = started_state == 0; if (not_started) { @@ -6546,7 +6547,7 @@ mono_threads_summarize_execute_internal (MonoContext *ctx, gchar **out, MonoStac { static SummarizerGlobalState state; - int current_idx; + int current_idx = 0; MonoNativeThreadId current = mono_native_thread_id_get (); gboolean thread_given_control = summarizer_state_init (&state, current, ¤t_idx); -- 2.11.4.GIT