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 | e4d6670f6bed2d933664eff37e4dc73c0fa7c933 (patch) | |
| tree | c41948b56d1b933616f419e086133799ebc84b94 /llvm/lib | |
| parent | abfb58d1d2f731b2ef3172f5dbf4584c495c1d6a (diff) | |
| download | bcm5719-llvm-e4d6670f6bed2d933664eff37e4dc73c0fa7c933.tar.gz bcm5719-llvm-e4d6670f6bed2d933664eff37e4dc73c0fa7c933.zip | |
Add an assertion to catch attempts to access off the end of the array.
Based on a patch by Javier Martinez.
llvm-svn: 103391
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index e9de6d56f9a..000cdb44ff5 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/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]; } } |

