mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ClangImporter] Fix another lifetime extension issue. (#5255)
The StringRef here referred to a temporary std::string. rdar://problem/28699869
This commit is contained in:
@@ -1137,8 +1137,9 @@ void ClangImporter::collectSubModuleNames(
|
||||
}
|
||||
auto submoduleNameLength = submodule->getFullModuleName().length();
|
||||
for (auto sub : submodule->submodules()) {
|
||||
StringRef full = sub->getFullModuleName();
|
||||
names.push_back(full.substr(submoduleNameLength + 1).str());
|
||||
std::string full = sub->getFullModuleName();
|
||||
full.erase(0, submoduleNameLength + 1);
|
||||
names.push_back(std::move(full));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user