"|" used when "||" was meant in SBTarget::FindFunctions
authorJim Ingham <jingham@apple.com>
Thu, 6 Aug 2020 02:01:17 +0000 (19:01 -0700)
committerJim Ingham <jingham@apple.com>
Thu, 6 Aug 2020 02:02:00 +0000 (19:02 -0700)
lldb/source/API/SBTarget.cpp
lldb/test/API/python_api/target/TestTargetAPI.py

index 04540a2..34cab62 100644 (file)
@@ -1791,7 +1791,7 @@ lldb::SBSymbolContextList SBTarget::FindFunctions(const char *name,
                      (const char *, uint32_t), name, name_type_mask);
 
   lldb::SBSymbolContextList sb_sc_list;
-  if (!name | !name[0])
+  if (!name || !name[0])
     return LLDB_RECORD_RESULT(sb_sc_list);
 
   TargetSP target_sp(GetSP());
index 5bdbf90..7db5388 100644 (file)
@@ -283,6 +283,10 @@ class TargetAPITestCase(TestBase):
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
 
+        # Try it with a null name:
+        list = target.FindFunctions(None, lldb.eFunctionNameTypeAuto)
+        self.assertTrue(list.GetSize() == 0)
+        
         list = target.FindFunctions('c', lldb.eFunctionNameTypeAuto)
         self.assertTrue(list.GetSize() == 1)