mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-02 07:32:52 +00:00
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
This commit is contained in:
parent
7505faf225
commit
ad017dcb3a
@ -5428,6 +5428,8 @@ const EVT *SDNode::getValueTypeList(EVT VT) {
|
|||||||
sys::SmartScopedLock<true> Lock(*VTMutex);
|
sys::SmartScopedLock<true> Lock(*VTMutex);
|
||||||
return &(*EVTs->insert(VT).first);
|
return &(*EVTs->insert(VT).first);
|
||||||
} else {
|
} else {
|
||||||
|
assert(VT.getSimpleVT().SimpleTy < MVT::LAST_VALUETYPE &&
|
||||||
|
"Value type out of range!");
|
||||||
return &SimpleVTArray->VTs[VT.getSimpleVT().SimpleTy];
|
return &SimpleVTArray->VTs[VT.getSimpleVT().SimpleTy];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user