fix crashes in type checking, as reported by Pranav Kant
MODIFY
ir/instr.cpp
ir/instr.cpp
@@ -1108,7 +1108,7 @@ expr ExtractValue::getTypeConstraints(const Function &f) const {
type = &ty->getChild(idx);
c &= ty->numElements().ugt(idx);
- if (++i == idxs.size())
+ if (++i == idxs.size() && idx < ty->numElementsConst())
c &= ty->getChild(idx) == getType();
}
return c;

MODIFY
ir/type.cpp
ir/type.cpp
@@ -677,6 +677,7 @@ AggregateType::AggregateType(string &&name, bool symbolic)
elements = 4;
sym.resize(elements);
children.resize(elements);
+ is_padding.resize(elements);
// FIXME: limitation below is for vectors; what about structs and arrays?
for (unsigned i = 0; i < elements; ++i) {

fix crashes in type checking, as reported by Pranav Kant