mirror of
https://github.com/Smaug123/WoofWare.PawPrint
synced 2025-10-11 08:48:38 +00:00
Finish initialising class of the main method before execution (#59)
This commit is contained in:
@@ -527,7 +527,7 @@ module DumpedAssembly =
|
||||
(baseTypeInfo : BaseTypeInfo option)
|
||||
: ResolvedBaseType
|
||||
=
|
||||
let rec go (baseType : BaseTypeInfo option) =
|
||||
let rec go (source : AssemblyName) (baseType : BaseTypeInfo option) =
|
||||
match baseType with
|
||||
| Some (BaseTypeInfo.TypeRef r) ->
|
||||
let assy = loadedAssemblies.[source.FullName]
|
||||
@@ -539,7 +539,7 @@ module DumpedAssembly =
|
||||
| TypeResolutionResult.Resolved (assy, typeInfo) ->
|
||||
match TypeInfo.isBaseType bct _.Name assy.Name typeInfo.TypeDefHandle with
|
||||
| Some v -> v
|
||||
| None -> go typeInfo.BaseType
|
||||
| None -> go assy.Name typeInfo.BaseType
|
||||
| Some (BaseTypeInfo.ForeignAssemblyType (assy, ty)) ->
|
||||
let assy = loadedAssemblies.[assy.FullName]
|
||||
|
||||
@@ -547,7 +547,7 @@ module DumpedAssembly =
|
||||
| Some v -> v
|
||||
| None ->
|
||||
let ty = assy.TypeDefs.[ty]
|
||||
go ty.BaseType
|
||||
go assy.Name ty.BaseType
|
||||
| Some (BaseTypeInfo.TypeSpec _) -> failwith "TODO"
|
||||
| Some (BaseTypeInfo.TypeDef h) ->
|
||||
let assy = loadedAssemblies.[source.FullName]
|
||||
@@ -556,7 +556,7 @@ module DumpedAssembly =
|
||||
| Some v -> v
|
||||
| None ->
|
||||
let ty = assy.TypeDefs.[h]
|
||||
go ty.BaseType
|
||||
go assy.Name ty.BaseType
|
||||
| None -> ResolvedBaseType.Object
|
||||
|
||||
go baseTypeInfo
|
||||
go source baseTypeInfo
|
||||
|
@@ -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.
|
||||
|
Reference in New Issue
Block a user