Skip to content

Commit

Permalink
Uses breadth-first node walking in TypeAnalyzer::basicRun()
Browse files Browse the repository at this point in the history
For correct inference of the parallel paths in a graph
it is critical to perform traverse breadth-first.

Otherwise, phi nodes may have their incomings undefined.

Issue: #17
Issue: #92
  • Loading branch information
0x7CFE committed Jul 1, 2016
1 parent 15d4d04 commit 5b7bcb5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/TypeAnalyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void TypeAnalyzer::fillLinkerClosures() {

bool TypeAnalyzer::basicRun() {
m_walker.resetStopNodes();
m_walker.run(*m_graph.nodes_begin(), Walker::wdForward, GraphWalker::wtDepthFirst, true);
m_walker.run(*m_graph.nodes_begin(), Walker::wdForward, GraphWalker::wtBreadthFirst, true);

return m_context.getRawReturnType().getSubTypes().size() == 1;
}
Expand Down

0 comments on commit 5b7bcb5

Please sign in to comment.