[sysprof] elf: handle NULL lookaside



commit 1ef9fc1e301acec377be7136ee2cd53637c8ad1a
Author: Christian Hergert <chergert redhat com>
Date:   Mon Sep 5 20:51:58 2022 -0700

    elf: handle NULL lookaside
    
    This code uses the hashtable directly to avoid the overhead of calling
    the path which creates ProcessInfo entries. So we need to also handle
    the chance the lookaside is NULL.

 src/libsysprof/sysprof-elf-symbol-resolver.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/libsysprof/sysprof-elf-symbol-resolver.c b/src/libsysprof/sysprof-elf-symbol-resolver.c
index 163f46c9..bd9b82c5 100644
--- a/src/libsysprof/sysprof-elf-symbol-resolver.c
+++ b/src/libsysprof/sysprof-elf-symbol-resolver.c
@@ -554,8 +554,10 @@ sysprof_elf_symbol_resolver_resolve_full (SysprofElfSymbolResolver *self,
   if (!(pi = g_hash_table_lookup (self->processes, GINT_TO_POINTER (pid))))
     return FALSE;
 
-  map = sysprof_map_lookaside_lookup (pi->lookaside, address);
-  if G_UNLIKELY (map == NULL)
+  if (pi->lookaside == NULL)
+    return FALSE;
+
+  if (!(map = sysprof_map_lookaside_lookup (pi->lookaside, address)))
     return FALSE;
 
   address -= map->start;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]