Skip to content

Commit

Permalink
Fix #2405: Assertion fail in TDCU
Browse files Browse the repository at this point in the history
  • Loading branch information
siegfriedpammer committed May 29, 2021
1 parent e886e39 commit 584d184
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -652,9 +652,16 @@ DisplayClass HandleMonoStateMachine(ILFunction function, ILVariable thisVariable
.FirstOrDefault(t => t.IsThis() && t.Type.GetDefinition() == decompilationContext.CurrentTypeDefinition);
if (thisVar == null)
{
thisVar = new ILVariable(VariableKind.Parameter, decompilationContext.CurrentTypeDefinition, -1) { Name = "this" };
thisVar = new ILVariable(VariableKind.Parameter, decompilationContext.CurrentTypeDefinition, -1) {
Name = "this", StateMachineField = thisField
};
function.Variables.Add(thisVar);
}
else if (thisVar.StateMachineField != null && displayClass.VariablesToDeclare.ContainsKey(thisVar.StateMachineField))
{
// "this" was already added previously, no need to add it twice.
return displayClass;
}
VariableToDeclare variableToDeclare = new VariableToDeclare(displayClass, thisField, thisVar);
displayClass.VariablesToDeclare.Add(thisField, variableToDeclare);
}
Expand Down

0 comments on commit 584d184

Please sign in to comment.