diff options
author | Duncan Sands <baldrick@free.fr> | 2010-05-10 04:54:28 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2010-05-10 04:54:28 +0000 |
commit | ad017dcb3a41bb053a6a5fa873d07222763dae75 (patch) | |
tree | 173ded1f9afe8081a6e1bed1f6f48dd19a6c1c66 /lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | 7505faf2254da21f4e1f40108301c3aa2b218f36 (diff) | |
download | external_llvm-ad017dcb3a41bb053a6a5fa873d07222763dae75.zip external_llvm-ad017dcb3a41bb053a6a5fa873d07222763dae75.tar.gz external_llvm-ad017dcb3a41bb053a6a5fa873d07222763dae75.tar.bz2 |
Add an assertion to catch attempts to access off the end of the array.
Based on a patch by Javier Martinez.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103391 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index e9de6d5..000cdb4 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -5428,6 +5428,8 @@ const EVT *SDNode::getValueTypeList(EVT VT) { 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]; } } |