Fix incorrect assertion in AVRFrameLowering.cpp

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

llvm-svn: 283640
diff --git a/llvm/lib/Target/AVR/AVRFrameLowering.cpp b/llvm/lib/Target/AVR/AVRFrameLowering.cpp
index dd70078..ab95be8 100644
--- a/llvm/lib/Target/AVR/AVRFrameLowering.cpp
+++ b/llvm/lib/Target/AVR/AVRFrameLowering.cpp
@@ -145,8 +145,9 @@
   }
 
   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>();