Skip to content

Commit 3dd3c88

Browse files
authored
Remove corert#2785 BadImageFormatException workaround from ILCompiler (#127591)
Removes the long-standing hack in `ILCompiler/Program.cs` that silently swallowed `BadImageFormatException` when loading input files — originally added to tolerate native DLLs mixed into CoreCLR test trees (corert#2785). That scenario no longer applies.
1 parent c77572b commit 3dd3c88

1 file changed

Lines changed: 1 addition & 24 deletions

File tree

src/coreclr/tools/aot/ILCompiler/Program.cs

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -129,30 +129,7 @@ public int Run()
129129
genericCycleDepthCutoff: Get(_command.MaxGenericCycleDepth),
130130
genericCycleBreadthCutoff: Get(_command.MaxGenericCycleBreadth));
131131

132-
//
133-
// TODO: To support our pre-compiled test tree, allow input files that aren't managed assemblies since
134-
// some tests contain a mixture of both managed and native binaries.
135-
//
136-
// See: https://github.com/dotnet/corert/issues/2785
137-
//
138-
// When we undo this hack, replace the foreach with
139-
// typeSystemContext.InputFilePaths = _command.Result.GetValueForArgument(inputFilePaths);
140-
//
141-
Dictionary<string, string> inputFilePaths = new Dictionary<string, string>();
142-
foreach (var inputFile in _command.Result.GetValue(_command.InputFilePaths))
143-
{
144-
try
145-
{
146-
var module = typeSystemContext.GetModuleFromPath(inputFile.Value);
147-
inputFilePaths.Add(inputFile.Key, inputFile.Value);
148-
}
149-
catch (TypeSystemException.BadImageFormatException)
150-
{
151-
// Keep calm and carry on.
152-
}
153-
}
154-
155-
typeSystemContext.InputFilePaths = inputFilePaths;
132+
typeSystemContext.InputFilePaths = _command.Result.GetValue(_command.InputFilePaths);
156133
typeSystemContext.ReferenceFilePaths = Get(_command.ReferenceFiles);
157134
if (!typeSystemContext.InputFilePaths.ContainsKey(systemModuleName)
158135
&& !typeSystemContext.ReferenceFilePaths.ContainsKey(systemModuleName))

0 commit comments

Comments
 (0)