// Wrong register class, realloc, copy and transfer ownership.
RegStorage new_reg = AllocTypedTemp(rl_src.fp, op_kind);
OpRegCopy(new_reg, rl_src.reg);
- // Clobber the old reg.
+ // Clobber the old regs and free it.
Clobber(rl_src.reg);
+ FreeTemp(rl_src.reg);
// ...and mark the new one live.
rl_src.reg = new_reg;
MarkLive(rl_src);
// Wrong register class, realloc, copy and transfer ownership.
RegStorage new_regs = AllocTypedTempWide(rl_src.fp, op_kind);
OpRegCopyWide(new_regs, rl_src.reg);
- // Clobber the old regs.
+ // Clobber the old regs and free it.
Clobber(rl_src.reg);
+ FreeTemp(rl_src.reg);
// ...and mark the new ones live.
rl_src.reg = new_regs;
MarkLive(rl_src);