Prevent stack overflow in Check()
This commit is contained in:
parent
7222bdbe42
commit
c3eacf9000
|
@ -40,6 +40,12 @@ namespace de4dot.code.renamer {
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Check(MTypeDef type) {
|
public bool Check(MTypeDef type) {
|
||||||
|
return Check(type, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Check(MTypeDef type, int recurseCount) {
|
||||||
|
if (recurseCount >= 100)
|
||||||
|
return false;
|
||||||
if (results.ContainsKey(type))
|
if (results.ContainsKey(type))
|
||||||
return results[type];
|
return results[type];
|
||||||
|
|
||||||
|
@ -53,7 +59,7 @@ namespace de4dot.code.renamer {
|
||||||
val = false;
|
val = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
val = Check(type.baseType.typeDef);
|
val = Check(type.baseType.typeDef, recurseCount + 1);
|
||||||
|
|
||||||
results[type] = val;
|
results[type] = val;
|
||||||
return val;
|
return val;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user