libsysprof-analyze: check cached ELF for build-id/file-inode

Just because it's cached doesn't mean we should just trust it. It could
have gotten added to the cache previously even though we didn't match.
This commit is contained in:
Christian Hergert
2023-05-22 19:53:38 -07:00
parent 839695dcd1
commit 5cc55117c3

View File

@ -375,7 +375,11 @@ sysprof_elf_loader_load (SysprofElfLoader *self,
if (g_hash_table_lookup_extended (self->cache, path, NULL, (gpointer *)&cached_elf))
{
if (cached_elf != NULL)
return g_object_ref (cached_elf);
{
if (sysprof_elf_matches (cached_elf, file_inode, build_id))
return g_object_ref (cached_elf);
}
continue;
}