This is an archive of the discontinued LLVM Phabricator instance.

[LLDB] Fix logically dead code
ClosedPublic

Authored by kwk on Sep 23 2019, 6:37 AM.

Details

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://scan3.coverity.com/reports.htm#v39507/p12195/fileInstanceId=27614986&defectInstanceId=8037484&mergedDefectId=221581

CID 221581

Diff Detail

Repository
rL LLVM

Event Timeline

kwk created this revision.Sep 23 2019, 6:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 23 2019, 6:37 AM
kwk edited the summary of this revision. (Show Details)

Personally I would check GIT history for some reasons it was written this way.

jankratochvil accepted this revision.Sep 23 2019, 7:01 AM
In D67915#1679030, @kwk wrote:

I expected some archeology like: D16004 added operator==() where e_num was already a constant. e_num was added in D9471 and it was also a constant there.
So yes, the fix is OK.

This revision is now accepted and ready to land.Sep 23 2019, 7:01 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptSep 23 2019, 7:04 AM