diff options
author | dotnet-bot <dotnet-bot@microsoft.com> | 2017-09-20 04:21:28 +0300 |
---|---|---|
committer | dotnet-bot <dotnet-bot@microsoft.com> | 2017-09-20 04:21:28 +0300 |
commit | cbf67af90e6c5457f54a2fa5be0035195ec94635 (patch) | |
tree | 8291626b3aab11380ef1c23a123d96b70fee5b27 /src/ILCompiler.Compiler | |
parent | 7d62ca86e5b765d4cfa7283a2fde15166a974465 (diff) |
ProjectX: Fix a bug in GetDebugMethodRVAToTokenMap
GetTypicalMethodDefinition should be used to get the MSIL token instead of GetMethodDefinition
[tfs-changeset: 1674872]
Diffstat (limited to 'src/ILCompiler.Compiler')
-rw-r--r-- | src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugMethodMapSection.cs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugMethodMapSection.cs b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugMethodMapSection.cs index ec6a36e60..4a86c7104 100644 --- a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugMethodMapSection.cs +++ b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugMethodMapSection.cs @@ -91,12 +91,18 @@ namespace ILCompiler.DependencyAnalysis foreach (IMethodBodyNode emitted in emittedMethods) { - if (!(emitted.Method.GetMethodDefinition() is Internal.TypeSystem.Ecma.EcmaMethod)) + NonExternMethodSymbolNode methodNode = emitted as NonExternMethodSymbolNode; + if (methodNode != null && !methodNode.HasCompiledBody) { continue; } - EntityHandle methodHandle = pseudoAssembly.EmitMetadataHandleForTypeSystemEntity(emitted.Method.GetMethodDefinition()); + if (!(emitted.Method.GetTypicalMethodDefinition() is Internal.TypeSystem.Ecma.EcmaMethod)) + { + continue; + } + + EntityHandle methodHandle = pseudoAssembly.EmitMetadataHandleForTypeSystemEntity(emitted.Method.GetTypicalMethodDefinition()); Debug.Assert(methodHandle.Kind == HandleKind.MemberReference); uint methodToken = (uint)MetadataTokens.GetToken(methodHandle); uint methodTokenRid = methodToken & 0xFFFFFF; |