Fix unsafe memory access
authorRui Ueyama <ruiu@google.com>
Fri, 25 Jul 2014 19:46:31 +0000 (19:46 +0000)
committerRui Ueyama <ruiu@google.com>
Fri, 25 Jul 2014 19:46:31 +0000 (19:46 +0000)
commita821d327297e3089d7d893814bb8bf5dc5b68499
treee416238cc6c5e5d3789d4b0e0aa34980db94e528
parenta57d91c2aede9cb8c5e43ab86cfaebe4e43f0161
Fix unsafe memory access

The following expression

  m[i] = m[j]

where m is a DenseMap and i != j is not safe. m[j] returns a
reference, which would be invalidated when a rehashing occurs.
If rehashing occurs to make room for m[i], m[j] becomes
invalid, and that invalid reference would be used as the RHS
value of the expression.

llvm-svn: 213969
lld/lib/Passes/LayoutPass.cpp