This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] fix an invalid-iterator-use bug.
ClosedPublic

Authored by sanjoy on Mar 1 2015, 3:10 PM.

Details

Summary

In AArch64PromoteConstant::appendAndTransferDominatedUses,
InsertPts[NewPt] invalidates IPI. Therefore, `InsertPts[NewPt] =
std::move(IPI->second)` is not legal.

This was caught by running make check with
http://reviews.llvm.org/D7931.

Diff Detail

Repository
rL LLVM

Event Timeline

sanjoy updated this revision to Diff 20968.Mar 1 2015, 3:10 PM
sanjoy retitled this revision from to [AArch64] fix an invalid-iterator-use bug..
sanjoy updated this object.
sanjoy edited the test plan for this revision. (Show Details)
sanjoy added reviewers: t.p.northover, bkramer, grosbach.
sanjoy added a subscriber: Unknown Object (MLST).
bkramer accepted this revision.Mar 1 2015, 3:41 PM
bkramer edited edge metadata.

Ow, that's a subtle bug. Fix LGTM.

As a microoptimization we could erase IPI via the iterator after everything we moved everything. That would save a map lookup.

This revision is now accepted and ready to land.Mar 1 2015, 3:41 PM
This revision was automatically updated to reflect the committed changes.