Linker: Fix ASan failure from r243961
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 4 Aug 2015 13:23:30 +0000 (13:23 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 4 Aug 2015 13:23:30 +0000 (13:23 +0000)
commit5c935a9796b58e55de09dab4f545118817d72d44
tree2f1ad4f33950f7dfaf3dc8bc8e62419a0459a54a
parentb892465b6ce719531211e51d83e5f1ad1474a18c
Linker: Fix ASan failure from r243961

r243883 and r243961 made a use-after-free far more likely:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/6041/steps/check-llvm%20asan/logs/stdio

Unresolved nodes get inserted into the `Cycles` array.  If they later
get resolved through RAUW, we need to update the reference.  It's
interesting that this never hit before (maybe an asan-ified clang
bootstrap with `-flto -g` would have hit it, but I admit I haven't tried
anything quite that crazy).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243976 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/ValueMapper.cpp