Skip to content

Commit

Permalink
Fix iterator comparison bug in reaching_definitions.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
reuk committed Nov 24, 2017
1 parent f8e38fb commit 394c42d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
12 changes: 5 additions & 7 deletions src/analyses/reaching_definitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void rd_range_domaint::transform(
locationt to,
ai_baset &ai,
const namespacet &ns,
ai_domain_baset::edge_typet /*edge_type*/)
ai_domain_baset::edge_typet edge_type)
{
reaching_definitions_analysist *rd=
dynamic_cast<reaching_definitions_analysist*>(&ai);
Expand All @@ -79,7 +79,7 @@ void rd_range_domaint::transform(
transform_start_thread(ns, *rd);
// do argument-to-parameter assignments
else if(from->is_function_call())
transform_function_call(ns, from, to, *rd);
transform_function_call(ns, from, to, *rd, edge_type);
// cleanup parameters
else if(from->is_end_function())
transform_end_function(ns, from, to, *rd);
Expand Down Expand Up @@ -170,15 +170,13 @@ void rd_range_domaint::transform_function_call(
const namespacet &ns,
locationt from,
locationt to,
reaching_definitions_analysist &rd)
reaching_definitions_analysist &rd,
ai_domain_baset::edge_typet edge_type)
{
const code_function_callt &code=to_code_function_call(from->code);

goto_programt::const_targett next=from;
++next;

// only if there is an actual call, i.e., we have a body
if(next!=to)
if(edge_type != ai_domain_baset::edge_typet::FUNCTION_LOCAL)
{
for(valuest::iterator it=values.begin();
it!=values.end();
Expand Down
3 changes: 2 additions & 1 deletion src/analyses/reaching_definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ class rd_range_domaint:public ai_domain_baset
const namespacet &ns,
locationt from,
locationt to,
reaching_definitions_analysist &rd);
reaching_definitions_analysist &rd,
ai_domain_baset::edge_typet edge_type);
void transform_end_function(
const namespacet &ns,
locationt from,
Expand Down

0 comments on commit 394c42d

Please sign in to comment.