mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
Assert instead of going into an infinite loop!
llvm-svn: 11946
This commit is contained in:
parent
a0f42f5936
commit
07aebf1c49
@ -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
Block a user