[Lldb-commits] [lldb] r372608 - [LLDB] Fix logically dead code

Konrad Kleine via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 23 07:05:51 PDT 2019


Author: kwk
Date: Mon Sep 23 07:05:51 2019
New Revision: 372608

URL: http://llvm.org/viewvc/llvm-project?rev=372608&view=rev
Log:
[LLDB] Fix logically dead code

Summary:
The indicated dead code may have performed some action; that action will never occur.

In lldb_private::LoadedModuleInfoList::LoadedModuleInfo::operator ==(lldb_private::LoadedModuleInfoList::LoadedModuleInfo const &): Code can never be reached because of a logical contradiction (CWE-561)

Coverity Scan: https://scan.coverity.com/projects/kwk-llvm-project?tab=overview

CID 221581

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D67915

Modified:
    lldb/trunk/include/lldb/Core/LoadedModuleInfoList.h

Modified: lldb/trunk/include/lldb/Core/LoadedModuleInfoList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/LoadedModuleInfoList.h?rev=372608&r1=372607&r2=372608&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/LoadedModuleInfoList.h (original)
+++ lldb/trunk/include/lldb/Core/LoadedModuleInfoList.h Mon Sep 23 07:05:51 2019
@@ -84,9 +84,6 @@ public:
     }
 
     bool operator==(LoadedModuleInfo const &rhs) const {
-      if (e_num != rhs.e_num)
-        return false;
-
       for (size_t i = 0; i < e_num; ++i) {
         if (m_has[i] != rhs.m_has[i])
           return false;




More information about the lldb-commits mailing list