diff --git a/lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm b/lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm --- a/lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm +++ b/lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm @@ -370,7 +370,6 @@ 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; }