Skip to content

Commit

Permalink
Fix duplicate ILFunction annotations.
Browse files Browse the repository at this point in the history
  • Loading branch information
siegfriedpammer committed Jul 3, 2023
1 parent 7992d14 commit e8c1270
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions ICSharpCode.Decompiler/CSharp/CSharpDecompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1698,10 +1698,7 @@ void DecompileBody(IMethod method, EntityDeclaration entityDecl, DecompileRun de
var function = ilReader.ReadIL((MethodDefinitionHandle)method.MetadataToken, methodBody, cancellationToken: CancellationToken);
function.CheckInvariant(ILPhase.Normal);

if (entityDecl != null)
{
AddAnnotationsToDeclaration(method, entityDecl, function);
}
AddAnnotationsToDeclaration(method, entityDecl, function);

var localSettings = settings.Clone();
if (IsWindowsFormsInitializeComponentMethod(method))
Expand Down Expand Up @@ -1751,7 +1748,6 @@ void DecompileBody(IMethod method, EntityDeclaration entityDecl, DecompileRun de

entityDecl.AddChild(body, Roles.Body);
}
entityDecl.AddAnnotation(function);

CleanUpMethodDeclaration(entityDecl, body, function, localSettings.DecompileMemberBodies);
}
Expand Down

0 comments on commit e8c1270

Please sign in to comment.