Fix crash in AggressiveAntiDepBreaker with empty CriticalPathSet

If no register classes are added to CriticalPathRCs, then the CriticalPathSet
bitmask will be empty. In that case, ExcludeRegs must remain NULL or else this
line will cause a segfault:

  } else if ((ExcludeRegs != NULL) && ExcludeRegs->test(AntiDepReg)) {

I have no in-tree test case.

llvm-svn: 190584
This commit is contained in:
Hal Finkel 2013-09-12 04:22:31 +00:00
parent 3cd37e6456
commit 6f1ff8e1a8
1 changed files with 1 additions and 1 deletions

View File

@ -782,7 +782,7 @@ unsigned AggressiveAntiDepBreaker::BreakAntiDependencies(
if (MI == CriticalPathMI) {
CriticalPathSU = CriticalPathStep(CriticalPathSU);
CriticalPathMI = (CriticalPathSU) ? CriticalPathSU->getInstr() : 0;
} else {
} else if (CriticalPathSet.any()) {
ExcludeRegs = &CriticalPathSet;
}