mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
Assert instead of going into an infinite loop!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11946 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -361,11 +361,14 @@ RecTy *VarInit::getFieldType(const std::string &FieldName) const {
|
|||||||
|
|
||||||
Init *VarInit::getFieldInit(Record &R, const std::string &FieldName) const {
|
Init *VarInit::getFieldInit(Record &R, const std::string &FieldName) const {
|
||||||
if (RecordRecTy *RTy = dynamic_cast<RecordRecTy*>(getType()))
|
if (RecordRecTy *RTy = dynamic_cast<RecordRecTy*>(getType()))
|
||||||
if (const RecordVal *RV = R.getValue(VarName))
|
if (const RecordVal *RV = R.getValue(VarName)) {
|
||||||
if (Init *I = RV->getValue()->getFieldInit(R, FieldName))
|
Init *TheInit = RV->getValue();
|
||||||
|
assert(TheInit != this && "Infinite loop detected!");
|
||||||
|
if (Init *I = TheInit->getFieldInit(R, FieldName))
|
||||||
return I;
|
return I;
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user