Handle a half-full func.locations map.
If func.locations has not been properly resized to have an entry for all values, we should just full in the default location for the missing values instead of crashing.
This commit is contained in:
@@ -186,7 +186,9 @@ fn write_instruction(w: &mut Write,
|
|||||||
if !func.locations.is_empty() {
|
if !func.locations.is_empty() {
|
||||||
let regs = isa.register_info();
|
let regs = isa.register_info();
|
||||||
for r in func.dfg.inst_results(inst) {
|
for r in func.dfg.inst_results(inst) {
|
||||||
write!(s, ",{}", func.locations[r].display(®s))?
|
write!(s,
|
||||||
|
",{}",
|
||||||
|
func.locations.get(r).cloned().unwrap_or_default().display(®s))?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
write!(s, "]")?;
|
write!(s, "]")?;
|
||||||
|
|||||||
Reference in New Issue
Block a user