[PATCH] D14694: [ARM] Prevent use of a value pointed by end() iterator when placing a jump table

Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 16 08:43:54 PST 2015


This revision was automatically updated to reflect the committed changes.
Closed by commit rL253222: [ARM] Prevent use of a value pointed by end() iterator when placing a jump table (authored by petr.pavlu).

Changed prior to commit:
  http://reviews.llvm.org/D14694?vs=40252&id=40296#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D14694

Files:
  llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp

Index: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp
===================================================================
--- llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp
+++ llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp
@@ -589,6 +589,8 @@
   MachineBasicBlock *LastCorrectlyNumberedBB = nullptr;
   for (MachineBasicBlock &MBB : *MF) {
     auto MI = MBB.getLastNonDebugInstr();
+    if (MI == MBB.end())
+      continue;
 
     unsigned JTOpcode;
     switch (MI->getOpcode()) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14694.40296.patch
Type: text/x-patch
Size: 500 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151116/7ac70dac/attachment.bin>


More information about the llvm-commits mailing list