[Lldb-commits] [lldb] [LLDB] Fix crash in TypeSystemClang::GetIndexofChildMemberWithName. (PR #117808)
Michael Buch via lldb-commits
lldb-commits at lists.llvm.org
Thu Nov 28 02:44:43 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;
----------------
Michael137 wrote:
An alternative to this would be *not* clearing the vector inside of `TypeSystemClang::GetIndexForRecordChild` on failure. And instead it could return an `llvm::Expected<uint32_t>`. So then `GetIndexOfChildMemberWithName` can bail out on failure. That feels easier to reason about. Wdyt?
https://github.com/llvm/llvm-project/pull/117808
More information about the lldb-commits
mailing list