[Lldb-commits] [lldb] [LLDB][SBProgress] Fix bad optional access in sbprogress (PR #128971)

David Peixotto via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 26 16:07:02 PST 2025


================
@@ -40,7 +40,10 @@ SBProgress::~SBProgress() = default;
 void SBProgress::Increment(uint64_t amount, const char *description) {
   LLDB_INSTRUMENT_VA(amount, description);
 
-  m_opaque_up->Increment(amount, description);
+  std::optional<std::string> description_opt;
+  if (description && description[0])
----------------
dmpots wrote:

So this only calls increment if there is a non-null and non-empty description. Is that the correct behavior? Or should we still be calling increment with a `nullopt` in that case?

https://github.com/llvm/llvm-project/pull/128971


More information about the lldb-commits mailing list