From 95bf3839dc5d725a19b8abb2af52696b3756ac92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caio=20Santana=20Magalh=C3=A3es?= Date: Wed, 21 May 2025 22:47:15 -0300 Subject: [PATCH] Added support for .NET 7.0 and 8.0 --- src/Flee/Flee.csproj | 2 +- src/Flee/InternalTypes/FleeILGenerator.cs | 2 +- src/Flee/InternalTypes/Utility.cs | 6 ------ test/Flee.Test/Flee.Test.csproj | 2 +- 4 files changed, 3 insertions(+), 9 deletions(-) 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