[Lldb-commits] [PATCH] D74096: [lldb/API] Fix the dangling pointer issue in SBThread::GetStopDescription

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 5 16:01:38 PST 2020


JDevlieghere added inline comments.


================
Comment at: lldb/source/API/SBThread.cpp:361-363
             stop_desc =
                 exe_ctx.GetProcessPtr()->GetUnixSignals()->GetSignalAsCString(
                     stop_info_sp->GetValue());
----------------
friss wrote:
> I don't think this is generally safe. Creating a `std::string` from a nullptr is undefined (and the previous test makes it look like this pointer could be null).
`GetStopDescription` now returns a `std::string`, so it should be fine here?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74096/new/

https://reviews.llvm.org/D74096





More information about the lldb-commits mailing list