summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2010-05-10 04:54:28 +0000
committerDuncan Sands <baldrick@free.fr>2010-05-10 04:54:28 +0000
commite4d6670f6bed2d933664eff37e4dc73c0fa7c933 (patch)
treec41948b56d1b933616f419e086133799ebc84b94 /llvm/lib
parentabfb58d1d2f731b2ef3172f5dbf4584c495c1d6a (diff)
downloadbcm5719-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.cpp2
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];
}
}
OpenPOWER on IntegriCloud