[llvm] r283640 - Fix incorrect assertion in AVRFrameLowering.cpp

Dylan McKay via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 7 18:10:36 PDT 2016


Author: dylanmckay
Date: Fri Oct  7 20:10:36 2016
New Revision: 283640

URL: http://llvm.org/viewvc/llvm-project?rev=283640&view=rev
Log:
Fix incorrect assertion in AVRFrameLowering.cpp

This wasn't looking at the right instruction, and would always fail.

Modified:
    llvm/trunk/lib/Target/AVR/AVRFrameLowering.cpp

Modified: llvm/trunk/lib/Target/AVR/AVRFrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AVR/AVRFrameLowering.cpp?rev=283640&r1=283639&r2=283640&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AVR/AVRFrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/AVR/AVRFrameLowering.cpp Fri Oct  7 20:10:36 2016
@@ -145,8 +145,9 @@ void AVRFrameLowering::emitEpilogue(Mach
   }
 
   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>();




More information about the llvm-commits mailing list