From: pmf Date: Thu, 21 May 2009 03:57:42 +0000 (+0000) Subject: resourceview: add sanity check for irq exit event X-Git-Tag: v0.12.20~104 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=55a353066e6e0a0cdaf19af2fc3a1673b3cf5eb1;p=lttv.git resourceview: add sanity check for irq exit event git-svn-id: http://ltt.polymtl.ca/svn@3385 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/trunk/lttv/lttv/modules/gui/resourceview/eventhooks.c b/trunk/lttv/lttv/modules/gui/resourceview/eventhooks.c index e0a0e347..37d0a07f 100644 --- a/trunk/lttv/lttv/modules/gui/resourceview/eventhooks.c +++ b/trunk/lttv/lttv/modules/gui/resourceview/eventhooks.c @@ -846,7 +846,13 @@ int before_execmode_hook_irq(void *hook_data, void *call_data) if (minfo->name == LTT_EVENT_IRQ_ENTRY) { irq = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 0)); } else if (minfo->name == LTT_EVENT_IRQ_EXIT) { - irq = g_array_index(ts->cpu_states[cpu].irq_stack, gint, ts->cpu_states[cpu].irq_stack->len-1); + gint len = ts->cpu_states[cpu].irq_stack->len; + if(len) { + irq = g_array_index(ts->cpu_states[cpu].irq_stack, gint, len-1); + } + else { + return 0; + } } else return 0;