Add a missing check to avoid dereference null. No sensible test case possible. Sorry. rdar://11745134

llvm-svn: 159236
This commit is contained in:
Evan Cheng 2012-06-26 22:54:59 +00:00
parent c118395cff
commit a75127871c
1 changed files with 2 additions and 0 deletions

View File

@ -1802,6 +1802,8 @@ static bool isSuitableForMask(MachineInstr *&MI, unsigned SrcReg,
bool ARMBaseInstrInfo::
OptimizeCompareInstr(MachineInstr *CmpInstr, unsigned SrcReg, int CmpMask,
int CmpValue, const MachineRegisterInfo *MRI) const {
if (MRI->def_empty(SrcReg))
return false;
MachineRegisterInfo::def_iterator DI = MRI->def_begin(SrcReg);
if (llvm::next(DI) != MRI->def_end())