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: unassignedb...@nondot.org
          Reporter: llvm-...@redking.me.uk
                CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org,
                    tejohn...@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to