CodeGen: Don't iterate over operands after we've erased an MI
authorJustin Bogner <mail@justinbogner.com>
Fri, 25 Mar 2016 20:03:28 +0000 (20:03 +0000)
committerJustin Bogner <mail@justinbogner.com>
Fri, 25 Mar 2016 20:03:28 +0000 (20:03 +0000)
commitec0e7d2582abe0169ebde8fb2105d998bdc79d4d
treed9990be2bf10faa272120b8d12f65b236f501e96
parent750a90df6ab4d119fe0fab51715464dad5ebaf2b
CodeGen: Don't iterate over operands after we've erased an MI

This fixes a use-after-free introduced 3 years ago, in r182872 ;)

The code more or less worked because the memory that CopyMI was
pointing to happened to still be valid, but lots of tests would crash
if you ran under ASAN with the recycling allocator changes from
llvm.org/PR26808

llvm-svn: 264455
llvm/lib/CodeGen/RegisterCoalescer.cpp