From 55a353066e6e0a0cdaf19af2fc3a1673b3cf5eb1 Mon Sep 17 00:00:00 2001 From: pmf Date: Thu, 21 May 2009 03:57:42 +0000 Subject: [PATCH] resourceview: add sanity check for irq exit event git-svn-id: http://ltt.polymtl.ca/svn@3385 04897980-b3bd-0310-b5e0-8ef037075253 --- trunk/lttv/lttv/modules/gui/resourceview/eventhooks.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; -- 2.34.1