Skip to content

Commit b60b3c5

Browse files
authored
Merge b11b955 into 5d8e2b9
2 parents 5d8e2b9 + b11b955 commit b60b3c5

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Confuser.Core/Marker.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ protected internal virtual MarkerResult MarkProject(ConfuserProject proj, Confus
150150
if (module.IsExternal) {
151151
var rawModule = module.LoadRaw(proj.BaseDirectory);
152152
extModules.Add(rawModule);
153-
context.InternalResolver.AddToCache(ModuleDefMD.Load(rawModule, context.InternalResolver.DefaultModuleContext));
153+
var extModule = ModuleDefMD.Load(rawModule, context.InternalResolver.DefaultModuleContext);
154+
extModule.EnableTypeDefFindCache = true;
155+
context.InternalResolver.AddToCache(extModule);
154156
continue;
155157
}
156158

Confuser.Renamer/AnalyzePhase.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ void ParseParameters(IDnlibDef def, ConfuserContext context, NameService service
3131
protected override void Execute(ConfuserContext context, ProtectionParameters parameters) {
3232
var service = (NameService)context.Registry.GetService<INameService>();
3333
context.Logger.Debug("Building VTables & identifier list...");
34+
35+
foreach (ModuleDef moduleDef in parameters.Targets.OfType<ModuleDef>())
36+
moduleDef.EnableTypeDefFindCache = true;
37+
3438
foreach (IDnlibDef def in parameters.Targets.WithProgress(context.Logger)) {
3539
ParseParameters(def, context, service, parameters);
3640

@@ -54,6 +58,11 @@ protected override void Execute(ConfuserContext context, ProtectionParameters pa
5458
Analyze(service, context, parameters, def, true);
5559
context.CheckCancellation();
5660
}
61+
62+
foreach (ModuleDef moduleDef in parameters.Targets.OfType<ModuleDef>()) {
63+
moduleDef.EnableTypeDefFindCache = false;
64+
moduleDef.ResetTypeDefFindCache();
65+
}
5766
}
5867

5968
void RegisterRenamers(ConfuserContext context, NameService service) {

0 commit comments

Comments
 (0)