This is an archive of the discontinued LLVM Phabricator instance.

Fix FileManager invalidation issue for file redirect
ClosedPublic

Authored by asuhan on Oct 28 2019, 12:48 PM.

Details

Reviewers
arphaman
Summary

Insertion into SeenFileEntries can invalidate iterators, we need to do
another lookup on the re-intern path.

Diff Detail

Event Timeline

asuhan created this revision.Oct 28 2019, 12:48 PM
dexonsmith added inline comments.Oct 28 2019, 1:01 PM
clang/lib/Basic/FileManager.cpp
271–290

It's a little scary that NamedFileEnt is invalid after this, since there's a fair bit of code that follows. I could imagine this regressing. I suggest changing NamedFileEnt to a pointer that gets updated here.

asuhan updated this revision to Diff 226752.Oct 28 2019, 2:41 PM

Make NamedFileEnt a pointer and update it.

arphaman accepted this revision.Oct 28 2019, 6:23 PM

Thanks! LGTM.

This revision is now accepted and ready to land.Oct 28 2019, 6:23 PM
asuhan edited the summary of this revision. (Show Details)Oct 28 2019, 8:07 PM

I don't have commit access, could you land this @arphaman? Thanks!

compnerd closed this revision.Nov 8 2019, 2:03 PM
compnerd added a subscriber: compnerd.

GIT rb314414570c