Prevent stack overflow in Check()

This commit is contained in:
de4dot 2014-04-16 19:11:04 +02:00
parent 7222bdbe42
commit c3eacf9000

View File

@ -40,6 +40,12 @@ namespace de4dot.code.renamer {
}
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))
return results[type];
@ -53,7 +59,7 @@ namespace de4dot.code.renamer {
val = false;
}
else
val = Check(type.baseType.typeDef);
val = Check(type.baseType.typeDef, recurseCount + 1);
results[type] = val;
return val;