forked from OSchip/llvm-project
Fix usage of shared_ptr for array which may cause a undefined behaviour (use unique_ptr instead)
llvm-svn: 230630
This commit is contained in:
parent
e08dc42a73
commit
48fd3f62b9
|
@ -948,14 +948,14 @@ CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStopException(void)
|
|||
const lldb::SBProcess sbProcess = CMICmnLLDBDebugSessionInfo::Instance().GetProcess();
|
||||
lldb::SBThread sbThread = sbProcess.GetSelectedThread();
|
||||
const size_t nStopDescriptionLen = sbThread.GetStopDescription(nullptr, 0);
|
||||
std::shared_ptr<char> spStopDescription(new char[nStopDescriptionLen]);
|
||||
sbThread.GetStopDescription(spStopDescription.get(), nStopDescriptionLen);
|
||||
std::unique_ptr<char[]> apStopDescription(new char[nStopDescriptionLen]);
|
||||
sbThread.GetStopDescription(apStopDescription.get(), nStopDescriptionLen);
|
||||
|
||||
// MI print "*stopped,reason=\"exception-received\",exception=\"%s\",thread-id=\"%d\",stopped-threads=\"all\""
|
||||
const CMICmnMIValueConst miValueConst("exception-received");
|
||||
const CMICmnMIValueResult miValueResult("reason", miValueConst);
|
||||
CMICmnMIOutOfBandRecord miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_Stopped, miValueResult);
|
||||
const CMIUtilString strReason(spStopDescription.get());
|
||||
const CMIUtilString strReason(apStopDescription.get());
|
||||
const CMICmnMIValueConst miValueConst2(strReason);
|
||||
const CMICmnMIValueResult miValueResult2("exception", miValueConst2);
|
||||
bool bOk = miOutOfBandRecord.Add(miValueResult2);
|
||||
|
|
Loading…
Reference in New Issue