This revision was automatically updated to reflect the committed changes. Closed by commit rGa57a67c59b3f: Fix a use-after-free in GetXcodeSDKPath (authored by aprantl). Herald added a project: LLDB.
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80666/new/ https://reviews.llvm.org/D80666 Files: lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm Index: lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm =================================================================== --- lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm +++ 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; }
Index: lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm =================================================================== --- lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm +++ 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; }
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits