r369932 - Fix use of invalidated iterator introduced by r369680.

Alex L via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 26 10:56:14 PDT 2019


Thanks for the fix!

On Mon, 26 Aug 2019 at 10:29, Richard Smith via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> Author: rsmith
> Date: Mon Aug 26 10:31:06 2019
> New Revision: 369932
>
> URL: http://llvm.org/viewvc/llvm-project?rev=369932&view=rev
> Log:
> Fix use of invalidated iterator introduced by r369680.
>
> Modified:
>     cfe/trunk/lib/Basic/FileManager.cpp
>
> Modified: cfe/trunk/lib/Basic/FileManager.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/FileManager.cpp?rev=369932&r1=369931&r2=369932&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Basic/FileManager.cpp (original)
> +++ cfe/trunk/lib/Basic/FileManager.cpp Mon Aug 26 10:31:06 2019
> @@ -263,15 +263,15 @@ FileManager::getFileRef(StringRef Filena
>    // If the name returned by getStatValue is different than Filename,
> re-intern
>    // the name.
>    if (Status.getName() != Filename) {
> -    auto &NamedFileEnt =
> +    auto &NewNamedFileEnt =
>          *SeenFileEntries.insert({Status.getName(), &UFE}).first;
> -    assert((*NamedFileEnt.second).get<FileEntry *>() == &UFE &&
> +    assert((*NewNamedFileEnt.second).get<FileEntry *>() == &UFE &&
>             "filename from getStatValue() refers to wrong file");
> -    InterndFileName = NamedFileEnt.first().data();
> +    InterndFileName = NewNamedFileEnt.first().data();
>      // In addition to re-interning the name, construct a redirecting seen
> file
>      // entry, that will point to the name the filesystem actually wants
> to use.
>      StringRef *Redirect = new (CanonicalNameStorage)
> StringRef(InterndFileName);
> -    SeenFileInsertResult.first->second = Redirect;
> +    NamedFileEnt.second = Redirect;
>    }
>
>    if (UFE.isValid()) { // Already have an entry with this inode, return
> it.
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190826/e3b9bfb7/attachment.html>


More information about the cfe-commits mailing list