Skip to content

Commit 484e696

Browse files
committed
Add distances to property as variable in locst
Also fixes indentation and whitespace in the output function, and replaces unsigned with std::size_t, based on feedback from tautschn
1 parent 117d6c0 commit 484e696

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/path-symex/locs.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,23 @@ void locst::output(std::ostream &out) const
8686
{
8787
irep_idt function;
8888

89-
for(unsigned l=0; l<loc_vector.size(); l++)
89+
for(std::size_t l = 0; l < loc_vector.size(); l++)
9090
{
91-
const loct &loc=loc_vector[l];
92-
if(function!=loc.function)
91+
const loct &loc = loc_vector[l];
92+
if(function != loc.function)
9393
{
94-
function=loc.function;
94+
function = loc.function;
9595
out << "*** " << function << "\n";
9696
}
9797

9898
out << " L" << l << ": "
9999
// << loc.target->type << " "
100100
// << loc.target->location
101-
<< " " << as_string(ns, *loc.target) << "\n";
101+
<< " " << as_string(ns, *loc.target);
102+
if(loc_vector[l].distance_to_property
103+
!= std::numeric_limits<std::size_t>::max())
104+
out << " path length: " << loc_vector[l].distance_to_property;
105+
out << "\n";
102106

103107
if(!loc.branch_target.is_nil())
104108
out << " T: " << loc.branch_target << "\n";

src/path-symex/locs.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ struct loct
2727
target(_target),
2828
function(_function)
2929
{
30+
distance_to_property=std::numeric_limits<std::size_t>::max();
3031
}
3132

3233
goto_programt::const_targett target;
3334
irep_idt function;
34-
35+
std::size_t distance_to_property;
3536
// we only support a single branch target
3637
loc_reft branch_target;
3738
};

0 commit comments

Comments
 (0)