diff options
author | dotnet-bot <dotnet-bot@microsoft.com> | 2017-09-15 22:23:00 +0300 |
---|---|---|
committer | dotnet-bot <dotnet-bot@microsoft.com> | 2017-09-15 22:23:00 +0300 |
commit | 2bf8d2d9222c83112f82270d4a47613c07ba88d6 (patch) | |
tree | a1c01039a10d02e26dcf1a0a2c3ff1c5124f9de5 /src/ILCompiler.Compiler | |
parent | 6d933ee211185af69329ad20d8d37d6e5e4329c3 (diff) |
ProjectX: Bug fixes for metadata parsing
Changes include
1. Fixing a bug of resolving type references with namespaces
2. Do not fail fast if a type reference fails to resolve
3. Fix a bug of parsing merged assembly records
[tfs-changeset: 1674337]
Diffstat (limited to 'src/ILCompiler.Compiler')
-rw-r--r-- | src/ILCompiler.Compiler/src/Compiler/ILStreamReader.cs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/ILCompiler.Compiler/src/Compiler/ILStreamReader.cs b/src/ILCompiler.Compiler/src/Compiler/ILStreamReader.cs index 9d30c702c..e27edb3b2 100644 --- a/src/ILCompiler.Compiler/src/Compiler/ILStreamReader.cs +++ b/src/ILCompiler.Compiler/src/Compiler/ILStreamReader.cs @@ -175,14 +175,19 @@ namespace Internal.Compiler public bool TryReadLdtokenAsTypeSystemEntity(out TypeSystemEntity entity) { int token; - if (!TryReadLdtoken(out token)) + bool tokenResolved; + try { + tokenResolved = TryReadLdtoken(out token); + entity = tokenResolved ?(TypeSystemEntity)_methodIL.GetObject(token) : null; + } + catch (TypeSystemException.TypeLoadException) + { + tokenResolved = false; entity = null; - return false; } - entity = (TypeSystemEntity)_methodIL.GetObject(token); - return true; + return tokenResolved; } public TypeSystemEntity ReadLdtokenAsTypeSystemEntity() |