[Lldb-commits] [lldb] [LLDB] Fix crash in TypeSystemClang::GetIndexofChildMemberWithName. (PR #117808)

via lldb-commits lldb-commits at lists.llvm.org
Sun Dec 1 15:48:18 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:

And (to clarify a bit more), the reason that *that* is a problem is because at line 6759 below, we make a recursive call, but if it fails we don't return an error; instead *we continue executing in this function* (but now with a child_indexes vector that would be incorrect if the recursive call hadn't cleared it or restored it to its original state).

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


More information about the lldb-commits mailing list