magic pass: disable extra isArrayAsStructTy check

The check caused the pass to crash on the new MIB service.

Change-Id: Iad475d4e7368d17ebf6fee32f280b00bd874b780
This commit is contained in:
David van Moolenbroek 2015-11-11 05:40:52 +01:00 committed by Lionel Sambuc
parent fe7ecbbff1
commit 1be839e808

View File

@ -148,7 +148,22 @@ bool TypeUtil::isArrayAsStructTy(TYPECONST Type *type) {
if(!type->isStructTy()) {
return false;
}
return type->getNumContainedTypes() == 1 || type->getContainedType(0) == type->getContainedType(1);
if (type->getNumContainedTypes() == 1) {
return true;
}
/*
* This check is no longer used, because it may wrongly fail in the case of
* an array of instances of a structure that contains a union that is
* initialized in different ways for array element 0 and 1. What we really
* need is a check to see whether the elements are *compatible*, but we do
* not appear to have the means to do that here. We warn if the check fails
* so as to make sure that its removal is not the source of new problems.
*/
if (type->getContainedType(0) != type->getContainedType(1)) {
TypeUtilLog("strict isArrayAsStructTy test failed");
//return false;
}
return true;
}
unsigned TypeUtil::getHash(TYPECONST Type* type) {