diff options
| author | Dawn Perchik <dawn@burble.org> | 2015-09-25 18:08:45 +0000 |
|---|---|---|
| committer | Dawn Perchik <dawn@burble.org> | 2015-09-25 18:08:45 +0000 |
| commit | a556fe8ec36e0479c6e02fc8be7e6cd17444c7df (patch) | |
| tree | 6a1f7395e30b95a74e7eecd3836bfa5157474d89 | |
| parent | 8e3a7ede9480a965814bc341d1deac8f63d4e94f (diff) | |
| download | bcm5719-llvm-a556fe8ec36e0479c6e02fc8be7e6cd17444c7df.tar.gz bcm5719-llvm-a556fe8ec36e0479c6e02fc8be7e6cd17444c7df.zip | |
[lldb-mi] Fix assignment operator in CMIUtilString
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
| -rw-r--r-- | lldb/tools/lldb-mi/MIUtilString.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/lldb/tools/lldb-mi/MIUtilString.cpp b/lldb/tools/lldb-mi/MIUtilString.cpp index f1c766bbd52..176d9a6de74 100644 --- a/lldb/tools/lldb-mi/MIUtilString.cpp +++ b/lldb/tools/lldb-mi/MIUtilString.cpp @@ -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; } |

