提交 3c11c4c0 编写于 作者: J Jared Parsons

Merge pull request #6504 from jaredpar/emit

PEverify test
......@@ -67,6 +67,8 @@ internal AssemblyData(Assembly assembly)
private bool _containsNetModules;
internal IEnumerable<ModuleData> ModuleDatas => _fullNameToAssemblyDataMap.Values.Where(x => x.Kind == Kind.ModuleData).Select(x => x.ModuleData);
public RuntimeAssemblyManager()
{
_fullNameToAssemblyDataMap = new Dictionary<string, AssemblyData>(StringComparer.OrdinalIgnoreCase);
......@@ -430,8 +432,7 @@ public int Execute(string moduleName, int expectedOutputLength, out string outpu
public string DumpAssemblyData(out string dumpDirectory)
{
var modules = _fullNameToAssemblyDataMap.Values.Where(x => x.Kind == Kind.ModuleData).Select(x => x.ModuleData);
return DumpAssemblyData(modules, out dumpDirectory);
return DumpAssemblyData(ModuleDatas, out dumpDirectory);
}
public static string DumpAssemblyData(IEnumerable<ModuleData> modules, out string dumpDirectory)
......@@ -517,12 +518,15 @@ public string[] PeVerifyModules(string[] modulesToVerify, bool throwOnError = tr
StringBuilder errors = new StringBuilder();
List<string> allOutput = new List<string>();
// Disable all PEVerification due to https://github.com/dotnet/roslyn/issues/6190
#if false
foreach (var name in modulesToVerify)
{
var module = _fullNameToModuleDataMap[name];
var assemblyData = _fullNameToAssemblyDataMap[name];
if (assemblyData.Kind != Kind.ModuleData)
{
continue;
}
var module = assemblyData.ModuleData;
string[] output = CLRHelpers.PeVerify(module.Image);
if (output.Length > 0)
{
......@@ -548,10 +552,9 @@ public string[] PeVerifyModules(string[] modulesToVerify, bool throwOnError = tr
if (throwOnError && errors.Length > 0)
{
string dumpDir;
DumpAssemblyData(_fullNameToModuleDataMap.Values, out dumpDir);
DumpAssemblyData(ModuleDatas, out dumpDir);
throw new PeVerifyException(errors.ToString(), dumpDir);
}
#endif
return allOutput.ToArray();
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册