From: Ilia K Date: Thu, 26 Feb 2015 13:28:58 +0000 (+0000) Subject: Fix usage of shared_ptr for array which may cause a undefined behaviour (use unique_p... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=48fd3f62b964103f22031daed6e44970209a3372;p=platform%2Fupstream%2Fllvm.git Fix usage of shared_ptr for array which may cause a undefined behaviour (use unique_ptr instead) llvm-svn: 230630 --- diff --git a/lldb/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp b/lldb/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp index 847adf1..650856f 100644 --- a/lldb/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp +++ b/lldb/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp @@ -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 spStopDescription(new char[nStopDescriptionLen]); - sbThread.GetStopDescription(spStopDescription.get(), nStopDescriptionLen); + std::unique_ptr 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);