diff --git a/src/Flee/Flee.csproj b/src/Flee/Flee.csproj index 79ef155..f9fe596 100644 --- a/src/Flee/Flee.csproj +++ b/src/Flee/Flee.csproj @@ -8,7 +8,7 @@ Flee Contributors Flee Flee - net6.0;net5.0;netstandard2.1;netstandard2.0 + net8.0;net7.0;net6.0;net5.0;netstandard2.1;netstandard2.0 enable enable latest diff --git a/src/Flee/InternalTypes/FleeILGenerator.cs b/src/Flee/InternalTypes/FleeILGenerator.cs index 1f24002..b9dc007 100644 --- a/src/Flee/InternalTypes/FleeILGenerator.cs +++ b/src/Flee/InternalTypes/FleeILGenerator.cs @@ -264,6 +264,6 @@ public void ValidateLength() public int LabelCount => _myLabelCount; - private int ILGeneratorLength => Utility.GetILGeneratorLength(_myIlGenerator); + private int ILGeneratorLength => _myIlGenerator.ILOffset; } } diff --git a/src/Flee/InternalTypes/Utility.cs b/src/Flee/InternalTypes/Utility.cs index 2063bcd..5106b9d 100644 --- a/src/Flee/InternalTypes/Utility.cs +++ b/src/Flee/InternalTypes/Utility.cs @@ -318,12 +318,6 @@ public static MethodInfo GetOverloadedOperator(string name, Type sourceType, Bin return null; } - public static int GetILGeneratorLength(ILGenerator ilg) - { - System.Reflection.FieldInfo fi = typeof(ILGenerator).GetField("m_length", BindingFlags.Instance | BindingFlags.NonPublic); - return (int)fi.GetValue(ilg); - } - public static bool IsLongBranch(int startPosition, int endPosition) { return (endPosition - startPosition) > sbyte.MaxValue; diff --git a/test/Flee.Test/Flee.Test.csproj b/test/Flee.Test/Flee.Test.csproj index dd918a2..fad3676 100644 --- a/test/Flee.Test/Flee.Test.csproj +++ b/test/Flee.Test/Flee.Test.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 enable false