forked from OSchip/llvm-project
Assert instead of going into an infinite loop!
llvm-svn: 11946
This commit is contained in:
parent
18577345aa
commit
d959ab9208
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue