From 3f34c4625b73edc3888710a241d888a77364c903 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Fri, 9 Jun 2023 15:57:52 -0700 Subject: [PATCH] libsysprof-analyze: cleanup walking to root --- src/libsysprof-analyze/sysprof-callgraph.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/libsysprof-analyze/sysprof-callgraph.c b/src/libsysprof-analyze/sysprof-callgraph.c index 6c13eaf5..4a8b30a0 100644 --- a/src/libsysprof-analyze/sysprof-callgraph.c +++ b/src/libsysprof-analyze/sysprof-callgraph.c @@ -198,16 +198,19 @@ sysprof_callgraph_populate_callers (SysprofCallgraph *self, g_assert (node != NULL); for (const SysprofCallgraphNode *iter = node; - iter != NULL && iter->parent != NULL; + iter != NULL; iter = iter->parent) { - SysprofSymbol *parent_symbol = iter->parent->summary->symbol; - guint pos; - egg_bitset_add (iter->summary->traceables, list_model_index); - if (!g_ptr_array_find (iter->summary->callers, parent_symbol, &pos)) - g_ptr_array_add (iter->summary->callers, parent_symbol); + if (iter->parent != NULL) + { + SysprofSymbol *parent_symbol = iter->parent->summary->symbol; + guint pos; + + if (!g_ptr_array_find (iter->summary->callers, parent_symbol, &pos)) + g_ptr_array_add (iter->summary->callers, parent_symbol); + } } }