resourceview: add sanity check for irq exit event
authorpmf <pmf@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 21 May 2009 03:57:42 +0000 (03:57 +0000)
committerpmf <pmf@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 21 May 2009 03:57:42 +0000 (03:57 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@3385 04897980-b3bd-0310-b5e0-8ef037075253

trunk/lttv/lttv/modules/gui/resourceview/eventhooks.c

index e0a0e347323f042e42eecd25131004be7d674228..37d0a07f3d3f4b5f64bc3fafcd231788e87b0749 100644 (file)
@@ -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;
 
This page took 0.024716 seconds and 4 git commands to generate.