forked from OSchip/llvm-project
Fix a use-after-free in GetXcodeSDKPath
Introduced in https://reviews.llvm.org/D80595. Thanks Jonas for noticing! Differential Revision: https://reviews.llvm.org/D80666
This commit is contained in:
parent
f46bb9dd5c
commit
a57a67c59b
|
@ -370,7 +370,6 @@ llvm::StringRef HostInfoMacOSX::GetXcodeSDKPath(XcodeSDK sdk) {
|
|||
auto it = g_sdk_path.find(sdk.GetString());
|
||||
if (it != g_sdk_path.end())
|
||||
return it->second;
|
||||
std::string path = GetXcodeSDK(sdk);
|
||||
g_sdk_path.insert({sdk.GetString(), path});
|
||||
return path;
|
||||
auto it_new = g_sdk_path.insert({sdk.GetString(), GetXcodeSDK(sdk)});
|
||||
return it_new.first->second;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue