Fix crash bug on Windows.

Mutating the DenseMap here seems to cause the Windows executable
to crash. Don't use operator[] to access possibly nonexistent key.

llvm-svn: 218548
This commit is contained in:
Rui Ueyama 2014-09-26 22:27:42 +00:00
parent abce3c4e18
commit b774a0e750
1 changed files with 4 additions and 2 deletions

View File

@ -305,8 +305,10 @@ void Resolver::markLive(const Atom *atom) {
if (const DefinedAtom *defAtom = dyn_cast<DefinedAtom>(atom)) { if (const DefinedAtom *defAtom = dyn_cast<DefinedAtom>(atom)) {
for (const Reference *ref : *defAtom) for (const Reference *ref : *defAtom)
markLive(ref->target()); markLive(ref->target());
for (const Atom *target : _reverseRef[defAtom]) auto it = _reverseRef.find(defAtom);
markLive(target); if (it != _reverseRef.end())
for (const Atom *target : it->second)
markLive(target);
} }
} }