Skip to content

Commit 7182882

Browse files
Merge pull request #230 from peterschrammel/fault-localization
fault localization output when unable to localize
2 parents f496571 + 1ed3253 commit 7182882

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

src/cbmc/fault_localization.cpp

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,17 @@ void fault_localizationt::report(irep_idt goal_id)
258258
{
259259
if(goal_id==ID_nil)
260260
goal_id=failed->source.pc->source_location.get_property_id();
261+
261262
lpointst &lpoints = lpoints_map[goal_id];
262-
assert(!lpoints.empty());
263+
264+
if(lpoints.empty())
265+
{
266+
status() << "["+id2string(goal_id)+"]: \n"
267+
<< " unable to localize fault"
268+
<< eom;
269+
return;
270+
}
271+
263272
debug() << "Fault localization scores:" << eom;
264273
lpointt &max=lpoints.begin()->second;
265274
for(auto &l : lpoints)
@@ -443,11 +452,14 @@ void fault_localizationt::report(
443452
switch(bmc.ui)
444453
{
445454
case ui_message_handlert::PLAIN:
446-
status() << "\n** Most likely fault location:" << eom;
447-
for(auto &g : goal_map)
455+
if(cover_goals.number_covered()>0)
448456
{
449-
if(g.second.status!=goalt::statust::FAILURE) continue;
450-
report(g.first);
457+
status() << "\n** Most likely fault location:" << eom;
458+
for(auto &g : goal_map)
459+
{
460+
if(g.second.status!=goalt::statust::FAILURE) continue;
461+
report(g.first);
462+
}
451463
}
452464
break;
453465
case ui_message_handlert::XML_UI:

0 commit comments

Comments
 (0)