spv-in: fix flowgraph (#247)

Header blocks were incorrectly overwritten.
format
This commit is contained in:
Matus Talcik
2020-10-29 15:43:12 +01:00
committed by GitHub
parent 587dc01a2c
commit 4b43e282fc

View File

@@ -152,6 +152,12 @@ impl FlowGraph {
let (node_source_index, node_target_index) =
self.flow.edge_endpoints(edge_index).unwrap();
if self.flow[node_source_index].ty == Some(ControlFlowNodeType::Header)
|| self.flow[node_source_index].ty == Some(ControlFlowNodeType::Loop)
{
continue;
}
// Back
if self.flow[node_target_index].ty == Some(ControlFlowNodeType::Loop)
&& self.flow[node_source_index].id > self.flow[node_target_index].id