OSDN Git Service
(root)
/
android-x86
/
external-llvm-project.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f46bb9d
)
Fix a use-after-free in GetXcodeSDKPath
author
Adrian Prantl
<aprantl@apple.com>
Wed, 27 May 2020 21:26:15 +0000
(14:26 -0700)
committer
Adrian Prantl
<aprantl@apple.com>
Wed, 27 May 2020 21:27:16 +0000
(14:27 -0700)
Introduced in https://reviews.llvm.org/D80595. Thanks Jonas for noticing!
Differential Revision: https://reviews.llvm.org/D80666
lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm
patch
|
blob
|
history
diff --git
a/lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm
b/lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm
index
cb6f034
..
615f77b
100644
(file)
--- a/
lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm
+++ b/
lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm
@@
-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;
}