Fix nasty miscompilation

This commit is contained in:
khyperia 2021-06-03 14:00:18 +02:00
parent 92b680fdb9
commit a5e9fe751b

View File

@ -72,7 +72,9 @@ pub fn composite_construct(types: &FxHashMap<Word, Instruction>, function: &mut
// of bounds, but just stop optimizing instead of panicing here. // of bounds, but just stop optimizing instead of panicing here.
break; break;
} }
components[index] = Some(value); if components[index].is_none() {
components[index] = Some(value);
}
// Follow back one in the chain of OpCompositeInsert // Follow back one in the chain of OpCompositeInsert
cur_inst = match defs.get(&cur_inst.operands[1].unwrap_id_ref()) { cur_inst = match defs.get(&cur_inst.operands[1].unwrap_id_ref()) {
Some(i) => i, Some(i) => i,