This is an archive of the discontinued LLVM Phabricator instance.

[LibTooling] Fix dangling references in RangeSelector.
ClosedPublic

Authored by ymandel on May 23 2019, 9:10 AM.

Details

Summary

RangeSelector had a number of cases of capturing a StringRef in a lambda, which
lead to dangling references. This change converts all uses in the API of
StringRef to std::string to avoid this problem. std::string in the API is
a reasonable choice, because the combinators are always storing the string
beyond the life of the combinator construction.

Diff Detail

Repository
rL LLVM

Event Timeline

ymandel created this revision.May 23 2019, 9:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 23 2019, 9:10 AM
This revision is now accepted and ready to land.May 23 2019, 9:33 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMay 23 2019, 10:11 AM