]> granicus.if.org Git - llvm/commitdiff
Fix incorrect assertion in AVRFrameLowering.cpp
authorDylan McKay <dylanmckay34@gmail.com>
Sat, 8 Oct 2016 01:10:36 +0000 (01:10 +0000)
committerDylan McKay <dylanmckay34@gmail.com>
Sat, 8 Oct 2016 01:10:36 +0000 (01:10 +0000)
This wasn't looking at the right instruction, and would always fail.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283640 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/AVR/AVRFrameLowering.cpp

index dd7007892d0cc08eee0258252ab3d56ad1c982eb..ab95be8f3ab35be4dd1c7ecf0b6a0033e2d67cee 100644 (file)
@@ -145,8 +145,9 @@ void AVRFrameLowering::emitEpilogue(MachineFunction &MF,
   }
 
   MachineBasicBlock::iterator MBBI = MBB.getLastNonDebugInstr();
-  assert(MBBI == MBB.end() &&
+  assert(MBBI->getDesc().isReturn() &&
          "Can only insert epilog into returning blocks");
+
   DebugLoc DL = MBBI->getDebugLoc();
   const MachineFrameInfo &MFI = MF.getFrameInfo();
   const AVRMachineFunctionInfo *AFI = MF.getInfo<AVRMachineFunctionInfo>();