[llvm-commits] [llvm] r103391 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Duncan Sands baldrick at free.fr
Sun May 9 21:54:28 PDT 2010


Author: baldrick
Date: Sun May  9 23:54:28 2010
New Revision: 103391

URL: http://llvm.org/viewvc/llvm-project?rev=103391&view=rev
Log:
Add an assertion to catch attempts to access off the end of the array.
Based on a patch by Javier Martinez.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=103391&r1=103390&r2=103391&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Sun May  9 23:54:28 2010
@@ -5428,6 +5428,8 @@
     sys::SmartScopedLock<true> Lock(*VTMutex);
     return &(*EVTs->insert(VT).first);
   } else {
+    assert(VT.getSimpleVT().SimpleTy < MVT::LAST_VALUETYPE &&
+           "Value type out of range!");
     return &SimpleVTArray->VTs[VT.getSimpleVT().SimpleTy];
   }
 }





More information about the llvm-commits mailing list