Finish initialising class of the main method before execution (#59)

This commit is contained in:
Patrick Stevens
2025-06-20 14:39:06 +01:00
committed by GitHub
parent 5a7cf11a5f
commit c620152fb1
3 changed files with 60 additions and 24 deletions

View File

@@ -142,6 +142,17 @@ type MethodInstructions =
ExceptionRegions : ImmutableArray<ExceptionRegion>
}
static member OnlyRet : MethodInstructions =
let op = IlOp.Nullary NullaryIlOp.Ret
{
Instructions = [ op, 0 ]
Locations = Map.empty |> Map.add 0 op
LocalsInit = false
LocalVars = None
ExceptionRegions = ImmutableArray.Empty
}
/// <summary>
/// Represents detailed information about a method in a .NET assembly.
/// This is a strongly-typed representation of MethodDefinition from System.Reflection.Metadata.