mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
libsysprof-analyze: keey gbytes around for decoded access
This commit is contained in:
@ -73,7 +73,7 @@ sysprof_bundled_symbolizer_decode (SysprofBundledSymbolizer *self,
|
|||||||
beginptr = (char *)g_bytes_get_data (bytes, NULL);
|
beginptr = (char *)g_bytes_get_data (bytes, NULL);
|
||||||
endptr = beginptr + g_bytes_get_size (bytes);
|
endptr = beginptr + g_bytes_get_size (bytes);
|
||||||
|
|
||||||
for (gchar *ptr = beginptr;
|
for (char *ptr = beginptr;
|
||||||
ptr < endptr && (ptr + sizeof (Decoded)) < endptr;
|
ptr < endptr && (ptr + sizeof (Decoded)) < endptr;
|
||||||
ptr += sizeof (Decoded))
|
ptr += sizeof (Decoded))
|
||||||
{
|
{
|
||||||
@ -100,6 +100,7 @@ sysprof_bundled_symbolizer_decode (SysprofBundledSymbolizer *self,
|
|||||||
|
|
||||||
self->beginptr = beginptr;
|
self->beginptr = beginptr;
|
||||||
self->endptr = endptr;
|
self->endptr = endptr;
|
||||||
|
self->bytes = g_bytes_ref (bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -187,10 +188,13 @@ sysprof_bundled_symbolizer_symbolize (SysprofSymbolizer *symbolizer,
|
|||||||
if (self->n_symbols == 0)
|
if (self->n_symbols == 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
g_assert (self->symbols != NULL);
|
||||||
|
g_assert (self->n_symbols > 0);
|
||||||
|
|
||||||
ret = bsearch (&key,
|
ret = bsearch (&key,
|
||||||
self->symbols,
|
self->symbols,
|
||||||
self->n_symbols,
|
self->n_symbols,
|
||||||
sizeof *ret,
|
sizeof (Decoded),
|
||||||
search_for_symbol_cb);
|
search_for_symbol_cb);
|
||||||
|
|
||||||
if (ret == NULL || ret->offset == 0)
|
if (ret == NULL || ret->offset == 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user