1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

Fix this code to avoid implicit assumptions about the length of the array.

llvm-svn: 101530
This commit is contained in:
Dan Gohman 2010-04-16 20:08:45 +00:00
parent 7ac96eac03
commit 56bc819d8e

View File

@ -180,16 +180,8 @@ public:
uint32_t ValueTypeActions[(MVT::MAX_ALLOWED_VALUETYPE/32)*2];
public:
ValueTypeActionImpl() {
ValueTypeActions[0] = ValueTypeActions[1] = 0;
ValueTypeActions[2] = ValueTypeActions[3] = 0;
std::fill(ValueTypeActions, array_endof(ValueTypeActions), 0);
}
ValueTypeActionImpl(const ValueTypeActionImpl &RHS) {
ValueTypeActions[0] = RHS.ValueTypeActions[0];
ValueTypeActions[1] = RHS.ValueTypeActions[1];
ValueTypeActions[2] = RHS.ValueTypeActions[2];
ValueTypeActions[3] = RHS.ValueTypeActions[3];
}
LegalizeAction getTypeAction(LLVMContext &Context, EVT VT) const {
if (VT.isExtended()) {
if (VT.isVector()) {