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:
Eric Anholt
2017-04-23 11:55:14 -07:00
committed by Jakob Stoklund Olesen
parent b13cd2321c
commit a332c3d024

View File

@@ -100,6 +100,7 @@ pub fn legalize_function(func: &mut Function, cfg: &mut ControlFlowGraph, isa: &
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