[lldb] Check if we actually have a Clang type in ObjCLanguage::GetPossibleFormattersM...
authorRaphael Isemann <teemperor@gmail.com>
Mon, 11 Nov 2019 13:25:54 +0000 (14:25 +0100)
committerRaphael Isemann <teemperor@gmail.com>
Tue, 12 Nov 2019 08:59:04 +0000 (09:59 +0100)
We call IsPossibleDynamicType but we also need to check if this is a Clang type,
otherwise other languages with dynamic types (like Swift) might end up being interpreted
as potential Obj-C dynamic types.

lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp

index c5bfb57..0e0f8ae 100644 (file)
@@ -887,7 +887,7 @@ ObjCLanguage::GetPossibleFormattersMatches(ValueObject &valobj,
   bool canBeObjCDynamic =
       compiler_type.IsPossibleDynamicType(nullptr, check_cpp, check_objc);
 
-  if (canBeObjCDynamic) {
+  if (canBeObjCDynamic && ClangUtil::IsClangType(compiler_type)) {
     do {
       lldb::ProcessSP process_sp = valobj.GetProcessSP();
       if (!process_sp)