[llvm-bugs] [Bug 47089] New: The use of if (Condition) {...} else if (Condition) {...} pattern should be avoided.(llvm-project/lldb/source/Plugins/Language/ObjC/NSArray.cpp:line 826)

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Aug 10 03:01:48 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=47089

            Bug ID: 47089
           Summary: The use of if (Condition) {...} else if (Condition)
                    {...} pattern should be
                    avoided.(llvm-project/lldb/source/Plugins/Language/Obj
                    C/NSArray.cpp:line 826)
           Product: lldb
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at lists.llvm.org
          Reporter: info at ustchcs.com
                CC: jdevlieghere at apple.com, llvm-bugs at lists.llvm.org

The use of if (Condition) {...} else if (Condition) {...} pattern should be
avoided.
Code on line 827 cannot be executed.

commit e3546c78cabfbf670391a57766872f0a8e28a423

llvm-project/lldb/source/Plugins/Language/ObjC/NSArray.cpp:line 826

   814    if (class_name == g_NSArrayI) {
   815      if (runtime->GetFoundationVersion() >= 1436)
   816        return (new
Foundation1436::NSArrayISyntheticFrontEnd(valobj_sp));
   817      if (runtime->GetFoundationVersion() >= 1430)
   818        return (new
Foundation1430::NSArrayISyntheticFrontEnd(valobj_sp));
   819      else
   820        return (new
Foundation1300::NSArrayISyntheticFrontEnd(valobj_sp));
   821    } else if (class_name == g_NSArrayI_Transfer) {
   822        return (new
Foundation1436::NSArrayI_TransferSyntheticFrontEnd(valobj_sp));
   823    } else if (class_name == g_NSArray0) {
   824    } else if (class_name == g_NSFrozenArrayM) {
   825      return (new
Foundation1436::NSFrozenArrayMSyntheticFrontEnd(valobj_sp));
   826    } else if (class_name == g_NSArray0) {
   827      return (new NSArray0SyntheticFrontEnd(valobj_sp));

Reported by: Ustchcs Toolsets Bugfinder
(bugfinder-2.2: The use of if (Condition) {...} else if (Condition) {...}
pattern should be avoided.)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200810/dd681271/attachment.html>


More information about the llvm-bugs mailing list