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

Felipe de Azevedo Piovezan via lldb-commits lldb-commits at lists.llvm.org
Wed Dec 4 09:18:55 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;
             child_indexes.push_back(child_idx);
             if (field_type.GetIndexOfChildMemberWithName(
                     name, omit_empty_base_classes, child_indexes))
               return child_indexes.size();
-            child_indexes.pop_back();
-
+            child_indexes = save_indices;
----------------
felipepiovezan wrote:

Whichever is the resolution for the discussion above, we should at the very least `child_index = std::move(save_indices)` here

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


More information about the lldb-commits mailing list