1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

Assert instead of going into an infinite loop!

llvm-svn: 11946
This commit is contained in:
Chris Lattner 2004-02-28 16:31:53 +00:00
parent a0f42f5936
commit 07aebf1c49

View File

@ -361,11 +361,14 @@ RecTy *VarInit::getFieldType(const std::string &FieldName) const {
Init *VarInit::getFieldInit(Record &R, const std::string &FieldName) const {
if (RecordRecTy *RTy = dynamic_cast<RecordRecTy*>(getType()))
if (const RecordVal *RV = R.getValue(VarName))
if (Init *I = RV->getValue()->getFieldInit(R, FieldName))
if (const RecordVal *RV = R.getValue(VarName)) {
Init *TheInit = RV->getValue();
assert(TheInit != this && "Infinite loop detected!");
if (Init *I = TheInit->getFieldInit(R, FieldName))
return I;
else
return 0;
}
return 0;
}