diff options
| author | Greg Clayton <gclayton@apple.com> | 2018-04-30 21:06:30 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2018-04-30 21:06:30 +0000 |
| commit | c485f056b7766e4e52b91bc5f462bb2d1d8cca8a (patch) | |
| tree | de8b6c6ace70ad291629bdc6b1c8b1f7a68fa16e /lldb/source/Core/Module.cpp | |
| parent | dab8515370c7fd43782e72c46333e801454219cc (diff) | |
Fix expression parser to not accept any type whose basename matches for a type that must exist at root level
This patch fixes an issue where we weren't looking for exact matches in the expression parser and also fixed the type lookup logic in the Module.cpp. Tests added to make sure we don't regress.
Differential Revision: https://reviews.llvm.org/D46128
llvm-svn: 331227
Diffstat (limited to 'lldb/source/Core/Module.cpp')
| -rw-r--r-- | lldb/source/Core/Module.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp index 2066c4d29811..1ae4d4aaf578 100644 --- a/lldb/source/Core/Module.cpp +++ b/lldb/source/Core/Module.cpp @@ -1004,16 +1004,22 @@ size_t Module::FindTypes( } else { // The type is not in a namespace/class scope, just search for it by // basename - if (type_class != eTypeClassAny) { + if (type_class != eTypeClassAny && !type_basename.empty()) { // The "type_name_cstr" will have been modified if we have a valid type // class prefix (like "struct", "class", "union", "typedef" etc). FindTypes_Impl(sc, ConstString(type_basename), nullptr, append, max_matches, searched_symbol_files, typesmap); - typesmap.RemoveMismatchedTypes(type_class); + typesmap.RemoveMismatchedTypes(type_scope, type_basename, type_class, + exact_match); num_matches = typesmap.GetSize(); } else { num_matches = FindTypes_Impl(sc, name, nullptr, append, max_matches, searched_symbol_files, typesmap); + if (exact_match) { + std::string name_str(name.AsCString("")); + typesmap.RemoveMismatchedTypes(type_scope, name_str, type_class, + exact_match); + } } } if (num_matches > 0) |
