From 3c1f71d54d487806d4dfde0421b43e95d3662ea5 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Mon, 23 Feb 2009 18:23:41 +0100 Subject: Check whether a die has any children before iterating over it. * tapsets.cxx (iterate_over_cu_labels): Check dwarf_child result. --- tapsets.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tapsets.cxx') diff --git a/tapsets.cxx b/tapsets.cxx index 78d5a5b3..5d9d062f 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -1330,7 +1330,10 @@ struct dwflpp const char * sym = label_val.c_str(); Dwarf_Die die; - dwarf_child (cu, &die); + int res = dwarf_child (cu, &die); + if (res != 0) + return; // die without children, bail out. + static string function_name; do { -- cgit