Skip to content

Commit

Permalink
[lldb-mi] Fix assignment operator in CMIUtilString
Browse files Browse the repository at this point in the history
Fix assignment operator in CMIUtilString to not crash the debugger if it
is passed a NULL pointer, which can happen in code like the following:

    SBValue val;
    CMIUtilString s;
    //...
    s = val.GetSummary();

Patch from evgeny.leviant@gmail.com
Reviewed by: clayborg, ki.stfu
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D13094

llvm-svn: 248597
  • Loading branch information
Dawn Perchik committed Sep 25, 2015
1 parent 8e3a7ed commit a556fe8
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions lldb/tools/lldb-mi/MIUtilString.cpp
Expand Up @@ -63,14 +63,7 @@ CMIUtilString::CMIUtilString(const std::string& vrStr)
//--
CMIUtilString &CMIUtilString::operator=(const char *vpRhs)
{
if (*this == vpRhs)
return *this;

if (vpRhs != nullptr)
{
assign(vpRhs);
}

assign(vpRhs);
return *this;
}

Expand Down

0 comments on commit a556fe8

Please sign in to comment.