[Lldb-commits] [lldb] [LLDB] Fix crash in TypeSystemClang::GetIndexofChildMemberWithName. (PR #117808)
via lldb-commits
lldb-commits at lists.llvm.org
Sun Dec 1 15:37:51 PST 2024
================
@@ -6754,12 +6754,12 @@ size_t TypeSystemClang::GetIndexOfChildMemberWithName(
llvm::StringRef field_name = field->getName();
if (field_name.empty()) {
CompilerType field_type = GetType(field->getType());
+ std::vector<uint32_t> save_indices = child_indexes;
----------------
cmtice wrote:
Actually, I take that back. I've been playing around with this, and *not* clearing the vector is not a viable solution, because the code the clears the vector (when an error condition is encountered) is inside a loop that *also* pushes items into the vector. So there could be several successful iterations, lengthening the vector, but final failure. At the point of failure there could be some number of no-longer-valid indexes that have been added to the vector, so clearing it is the only option (other than saving it before the loop and restoring it when the error condition is encountered...).
https://github.com/llvm/llvm-project/pull/117808
More information about the lldb-commits
mailing list