In some occasions, SBValue::GetError can invalidate its cached
m_summary_str member. This in turn invalidates any StringRef variables
pointing to it.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
lldb/tools/lldb-vscode/JSONUtils.cpp | ||
---|---|---|
143 | Sorry for the late comment. The fix is fine but it depends on an important assumption that GetError() has to be called before GetSummary(). Can we add an explicit comment to document this so that future refactoring won't violate it again. |
lldb/tools/lldb-vscode/JSONUtils.cpp | ||
---|---|---|
143 | We shouldn't, we need to fix this API bug in LLDB itself. Just calling SBValue::GetError() shouldn't end up clearing the m_summary_str IMHO. This seems like the real bug. This is working around this. IF we add a comment, it won't end up being true when we fix the issue. |
Sorry for the late comment. The fix is fine but it depends on an important assumption that GetError() has to be called before GetSummary(). Can we add an explicit comment to document this so that future refactoring won't violate it again.