[llvm-bugs] [Bug 41663] New: LLParser::ParseSummaryEntry - unreachable code

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Apr 29 15:08:41 PDT 2019


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

            Bug ID: 41663
           Summary: LLParser::ParseSummaryEntry - unreachable code
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: llvm-dev at redking.me.uk
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    tejohnson at google.com
            Blocks: 41655

Reported in https://www.viva64.com/en/b/0629/

bool LLParser::ParseSummaryEntry() {
  ....
  switch (Lex.getKind()) {
  case lltok::kw_gv:
    return ParseGVEntry(SummaryID);
  case lltok::kw_module:
    return ParseModuleEntry(SummaryID);
  case lltok::kw_typeid:
    return ParseTypeIdEntry(SummaryID);                        // <=
    break;                                                     // <=
  default:
    return Error(Lex.getLoc(), "unexpected summary kind");
  }
  Lex.setIgnoreColonInIdentifiers(false);                      // <=
  return false;
}

The presence of the default case means the last 2 lines are unreachable


Introduced by @tejohnson at rL335602


Referenced Bugs:

https://bugs.llvm.org/show_bug.cgi?id=41655
[Bug 41655] Finding Bugs in LLVM 8 with PVS-Studio
-- 
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/20190429/de23aea5/attachment.html>


More information about the llvm-bugs mailing list