This commit is contained in:
Matthew Jin 2022-10-07 16:04:43 -07:00 коммит произвёл GitHub
Родитель 8759257844
Коммит 19bf547f15
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -165,6 +165,7 @@ namespace Cilsil.Services
// True if the translation terminates early, false otherwise.
var translationUnfinished = false;
int iterationCount = 0;
if (!method.IsAbstract && methodBody.Instructions.Count > 0)
{
@ -185,6 +186,7 @@ namespace Cilsil.Services
programState.PushInstruction(methodBody.Instructions.First(), initNode);
do
{
iterationCount++;
var nextInstruction = programState.PopInstruction();
// Checks if there is a node for the offset that we can reuse.
(var nodeAtOffset, var excessiveVisits) =
@ -221,6 +223,13 @@ namespace Cilsil.Services
translationUnfinished = true;
break;
}
else if (iterationCount > 100000)
{
TimeoutMethodCount++;
Log.WriteWarning("Translation timeout.");
Log.RecordUnfinishedMethod(programState.Method.GetCompatibleFullName(),
nextInstruction.RemainingInstructionCount());
}
else if (!InstructionParser.ParseCilInstruction(nextInstruction, programState))
{
Log.RecordUnfinishedMethod(programState.Method.GetCompatibleFullName(),