diff --git a/src/analyses/dependence_graph.cpp b/src/analyses/dependence_graph.cpp index af9a3aed953..6d691528ca8 100644 --- a/src/analyses/dependence_graph.cpp +++ b/src/analyses/dependence_graph.cpp @@ -188,7 +188,7 @@ void dep_graph_domaint::transform( goto_programt::const_targett to, ai_baset &ai, const namespacet &ns, - ai_domain_baset::edge_typet /*edge_type*/) + ai_domain_baset::edge_typet edge_type) { dependence_grapht *dep_graph=dynamic_cast(&ai); assert(dep_graph!=nullptr); @@ -196,10 +196,9 @@ void dep_graph_domaint::transform( // propagate control dependencies across function calls if(from->is_function_call()) { - goto_programt::const_targett next=from; - ++next; + const goto_programt::const_targett next = std::next(from); - if(next==to) + if(edge_type == ai_domain_baset::edge_typet::FUNCTION_LOCAL) { control_dependencies(from, to, *dep_graph); }