fix cfg node labeling
This commit is contained in:
parent
0a77c3af86
commit
ff2d630352
2 changed files with 4 additions and 5 deletions
|
|
@ -159,7 +159,6 @@ impl<'a> MethodCFG<'a> {
|
|||
last_labels.push(name.clone());
|
||||
} else {
|
||||
nodes_next_label.push(vec![]);
|
||||
last_labels.push(name.clone());
|
||||
nodes.push(MethodCFGNode {
|
||||
code_block: &insns[start_last_block..i],
|
||||
labels: last_labels,
|
||||
|
|
@ -167,7 +166,7 @@ impl<'a> MethodCFG<'a> {
|
|||
prev_nodes: vec![],
|
||||
});
|
||||
start_last_block = i;
|
||||
last_labels = vec![];
|
||||
last_labels = vec![name.clone()];
|
||||
}
|
||||
}
|
||||
Instruction::ReturnVoid {}
|
||||
|
|
|
|||
|
|
@ -73,11 +73,11 @@ impl MethodCFG<'_> {
|
|||
i += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let mut changed = true;
|
||||
while changed {
|
||||
let mut new_end_block_reg_tys = vec![];
|
||||
for node in &self.nodes {
|
||||
// The first node is empty and depend on the function signature, it must not change
|
||||
let mut new_end_block_reg_tys = vec![end_block_reg_tys[0].clone()];
|
||||
for node in self.nodes.iter().skip(1) {
|
||||
new_end_block_reg_tys.push(transform_reg_ty(
|
||||
&merge_input(node, nb_reg, &end_block_reg_tys),
|
||||
node,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue