From f2014a857aebf21e63cff7b7f1e46e7793ef9c09 Mon Sep 17 00:00:00 2001 From: PhilippNaused Date: Thu, 12 Feb 2026 20:53:07 +0100 Subject: [PATCH] Add MethodImplAttributes.Async flag --- src/DotNet/MethodDef.cs | 8 ++++++++ src/DotNet/MethodImplAttributes.cs | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/DotNet/MethodDef.cs b/src/DotNet/MethodDef.cs index 1411eb1ae..6fe8a88b9 100644 --- a/src/DotNet/MethodDef.cs +++ b/src/DotNet/MethodDef.cs @@ -853,6 +853,14 @@ public bool IsAggressiveOptimization { public bool HasSecurityMitigations { get => ((MethodImplAttributes)implAttributes & MethodImplAttributes.SecurityMitigations) != 0; set => ModifyImplAttributes(value, MethodImplAttributes.SecurityMitigations); + } + + /// + /// Gets/sets the bit + /// + public bool IsAsync { + get => ((MethodImplAttributes)implAttributes & MethodImplAttributes.Async) != 0; + set => ModifyImplAttributes(value, MethodImplAttributes.Async); } /// diff --git a/src/DotNet/MethodImplAttributes.cs b/src/DotNet/MethodImplAttributes.cs index b1d3b3a48..eaedf3ccd 100644 --- a/src/DotNet/MethodImplAttributes.cs +++ b/src/DotNet/MethodImplAttributes.cs @@ -46,5 +46,7 @@ public enum MethodImplAttributes : ushort { AggressiveOptimization = 0x0200, /// The JIT compiler should look for security mitigation attributes, such as the user-defined System.Runtime.CompilerServices.SecurityMitigationsAttribute. If found, the JIT compiler applies any related security mitigations. Available starting with .NET Framework 4.8. SecurityMitigations = 0x0400, + /// Method requires async state machine rewrite. Available starting with .NET 11.0. + Async = 0x2000, } }