diff options
Diffstat (limited to 'lldb/source/Commands/CommandObjectMemory.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectMemory.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp index 9034243..a8896f8 100644 --- a/lldb/source/Commands/CommandObjectMemory.cpp +++ b/lldb/source/Commands/CommandObjectMemory.cpp @@ -1047,13 +1047,13 @@ protected: DataBufferHeap buffer; if (m_memory_options.m_string.OptionWasSet()) { - std::optional<llvm::StringRef> str = - m_memory_options.m_string.GetStringValue(); - if (!str) { + llvm::StringRef str = + m_memory_options.m_string.GetStringValue().value_or(""); + if (str.empty()) { result.AppendError("search string must have non-zero length."); return false; } - buffer.CopyData(*str); + buffer.CopyData(str); } else if (m_memory_options.m_expr.OptionWasSet()) { StackFrame *frame = m_exe_ctx.GetFramePtr(); ValueObjectSP result_sp; |