]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarflint: Avoid corrupted access
authorDjordje Todorovic <djordje.todorovic@rt-rk.com>
Tue, 26 Sep 2017 13:40:25 +0000 (15:40 +0200)
committerMark Wielaard <mark@klomp.org>
Fri, 6 Oct 2017 19:38:48 +0000 (21:38 +0200)
Signed-off-by: Djordje Todorovic <djordje.todorovic@rt-rk.com>
dwarflint/locstats.cc

index 411e06cd1d08375a8559914564c85bc2070addd6..4f0507b4cd5f0972cecf2fd088812fb9845ee5c3 100644 (file)
@@ -622,7 +622,8 @@ process(Dwarf *c_dw, dwarf const &dw)
   std::cout << "cov%\tsamples\tcumul" << std::endl;
   for (int i = cov_00; i <= 100; ++i)
     {
-      cumulative += tally.find (i)->second;
+      if (tally.find (i) != tally.end())
+           cumulative += tally.find (i)->second;
       if (tabrules.match (i))
        {
          long int samples = cumulative - last;