Make sure that encodings has entries for all instructions after legalize().
If we generated new instructions as part of legalize, and the new instructions failed to legalize, we'd be left with a func.encodings[] that would panic when you dereferenced the inst.
This commit is contained in:
committed by
Jakob Stoklund Olesen
parent
b13cd2321c
commit
a332c3d024
@@ -100,6 +100,7 @@ pub fn legalize_function(func: &mut Function, cfg: &mut ControlFlowGraph, isa: &
|
|||||||
prev_pos = pos.position();
|
prev_pos = pos.position();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
func.encodings.resize(func.dfg.num_insts());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Include legalization patterns that were generated by `gen_legalizer.py` from the `XForms` in
|
// Include legalization patterns that were generated by `gen_legalizer.py` from the `XForms` in
|
||||||
|
|||||||
Reference in New Issue
Block a user