Skip to content

Commit

Permalink
Update decompiler submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
ElektroKill committed Feb 27, 2024
1 parent 348aff5 commit 30f93a8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,7 @@ public override void Decompile(ModuleDef mod, IDecompilerOutput output, Decompil
}

BuilderState CreateAstBuilder(DecompilationContext ctx, DecompilerSettings settings, ModuleDef? currentModule = null, TypeDef? currentType = null, bool isSingleMember = false) {
if (currentModule is null)
currentModule = currentType?.Module;
currentModule ??= currentType?.Module;
if (isSingleMember) {
settings = settings.Clone();
settings.UsingDeclarations = false;
Expand All @@ -320,7 +319,7 @@ BuilderState CreateAstBuilder(DecompilationContext ctx, DecompilerSettings setti
state.AstBuilder.Context.CancellationToken = ctx.CancellationToken;
state.AstBuilder.Context.CurrentType = currentType;
state.AstBuilder.Context.Settings = settings;
state.AstBuilder.InitializeTypeSystem();
state.AstBuilder.InitializeTypeSystem(ctx.GetOrCreate<TypeSystemCache>().GetTypeSystem(currentModule, settings));
return state;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
Expand Down Expand Up @@ -111,7 +111,8 @@ SourceStatementProvider GetDebugInfo(DecompilationContext ctx, MethodDef method,
state.AstBuilder.Context.CurrentType = method.DeclaringType;
state.AstBuilder.Context.CancellationToken = ctx.CancellationToken;
state.AstBuilder.Context.Settings = settings;
state.AstBuilder.InitializeTypeSystem();
state.AstBuilder.InitializeTypeSystem(ctx.GetOrCreate<ICSharpCode.Decompiler.TypeSystemCache>()
.GetTypeSystem(state.AstBuilder.Context.CurrentModule, settings));
state.AstBuilder.AddMethod(method);
state.AstBuilder.RunTransformations();
state.AstBuilder.GenerateCode(output);
Expand Down

0 comments on commit 30f93a8

Please sign in to comment.