[BOLT] Allow jump tables with 2 entries

Summary:
GCC 8 can generate jump tables with just 2 entries. Modify our heuristic
to accept it. We still assert that there's more than one entry.

(cherry picked from FBD8709416)
This commit is contained in:
Maksim Panchenko 2018-06-30 13:30:47 -07:00
parent 8835f90d1e
commit 6802948028
1 changed files with 2 additions and 2 deletions

View File

@ -867,8 +867,8 @@ IndirectBranchType BinaryFunction::processIndirectBranch(MCInst &Instruction,
}
if (Type == IndirectBranchType::POSSIBLE_JUMP_TABLE ||
Type == IndirectBranchType::POSSIBLE_PIC_JUMP_TABLE) {
assert(JTOffsetCandidates.size() > 2 &&
"expected more than 2 jump table entries");
assert(JTOffsetCandidates.size() > 1 &&
"expected more than one jump table entry");
auto JumpTableName = generateJumpTableName(ArrayStart);
auto JumpTableType =