fix off-by-one in marker id test
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Tue, 16 Oct 2007 03:32:57 +0000 (03:32 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Tue, 16 Oct 2007 03:32:57 +0000 (03:32 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@2703 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/ltt/marker.c
ltt/branches/poly/ltt/marker.h
ltt/branches/poly/ltt/tracefile.c

index 54209570f787c9fccbb72d3a1f46db95a5aaddf1..2a0d1cb132139d477b6f21a32b021f8b84a34a9e 100644 (file)
@@ -440,6 +440,7 @@ int marker_id_event(LttTrace *trace, GQuark name, guint16 id,
   info->pointer_size = pointer_size;
   info->size_t_size = size_t_size;
   info->alignment = alignment;
+  info->fields = NULL;
   info->next = NULL;
   head = marker_get_info_from_name(trace, name);
   if (!head)
index e3d4cd3d96b8706860563cba05fdcff998d212ea..73c7f24796c7d62d5c5e6bca0a20656e0d2e4d8a 100644 (file)
@@ -52,7 +52,7 @@ static inline guint16 marker_get_id_from_info(LttTrace *trace,
 static inline struct marker_info *marker_get_info_from_id(LttTrace *trace,
     guint16 id)
 {
-  if (unlikely(trace->markers->len < id))
+  if (unlikely(trace->markers->len <= id))
     return NULL;
   return &g_array_index(trace->markers, struct marker_info, id);
 }
index 097e9d2e54dfe54aa049fafd2c1ae90b883a7808..5ce20f2ff43af81f5cc696d54259f26f846e3871 100644 (file)
@@ -1874,6 +1874,7 @@ int ltt_tracefile_read_update_event(LttTracefile *tf)
     pos += sizeof(guint16);
   } else {
     /* Compact event */
+    event->event_size = 0xFFFF;
   }
 
   if (a_event_debug)
@@ -2113,6 +2114,7 @@ void ltt_update_event_size(LttTracefile *tf)
   }
 
   info = marker_get_info_from_id(tf->trace, tf->event.event_id);
+
   if (tf->event.event_id >= MARKER_CORE_IDS)
     g_assert(info != NULL);
 
This page took 0.025805 seconds and 4 git commands to generate.