mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +00:00
SDAGBuilder: Don't create an invalid iterator when there is only one switch case.
Found by libstdc++'s debug mode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157522 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c511b2a5a1
commit
5db954dab9
@ -1984,10 +1984,10 @@ bool SelectionDAGBuilder::handleSmallSwitchRange(CaseRec& CR,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Rearrange the case blocks so that the last one falls through if possible.
|
||||
Case &BackCase = *(CR.Range.second-1);
|
||||
if (NextBlock && Default != NextBlock && BackCase.BB != NextBlock) {
|
||||
if (Size > 1 &&
|
||||
NextBlock && Default != NextBlock && BackCase.BB != NextBlock) {
|
||||
// The last case block won't fall through into 'NextBlock' if we emit the
|
||||
// branches in this order. See if rearranging a case value would help.
|
||||
// We start at the bottom as it's the case with the least weight.
|
||||
|
Loading…
Reference in New Issue
Block a user