Bugfix: encode function wasn't calling legalize function properly

This commit is contained in:
Denis Merigoux
2017-07-27 16:30:48 -07:00
committed by Jakob Stoklund Olesen
parent 051aaed43e
commit b547b78683

View File

@@ -170,7 +170,7 @@ pub trait TargetIsa {
ctrl_typevar: ir::Type)
-> Result<Encoding, Legalize> {
let mut iter = self.legal_encodings(dfg, inst, ctrl_typevar);
iter.next().ok_or(iter.legalize().into())
iter.next().ok_or_else(|| iter.legalize().into())
}
/// Get a data structure describing the instruction encodings in this ISA.