From: Yi Zhang (CLR) Date: Fri, 28 Apr 2017 15:41:29 +0000 (-0700) Subject: Fix R2R issue with virtual method resolving to non-generic base (dotnet/coreclr#11289) X-Git-Tag: submit/tizen/20210909.063632~11030^2~7076 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4eff1525b36a1a9293ec23665dc775562bca910d;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Fix R2R issue with virtual method resolving to non-generic base (dotnet/coreclr#11289) Commit migrated from https://github.com/dotnet/coreclr/commit/6bfd4789a274c92f7839796f9ba7acfa1cc1e634 --- diff --git a/src/coreclr/src/vm/compile.cpp b/src/coreclr/src/vm/compile.cpp index 9161585..76a4147 100644 --- a/src/coreclr/src/vm/compile.cpp +++ b/src/coreclr/src/vm/compile.cpp @@ -1723,6 +1723,12 @@ mdToken CEECompileInfo::TryEncodeMethodAsToken( if (!pReferencingModule->IsInCurrentVersionBubble()) return mdTokenNil; + // If this is a MemberRef with TypeSpec, we might come to here because we resolved the method + // into a non-generic base class in the same version bubble. However, since we don't have the + // proper type context during ExternalMethodFixupWorker, we can't really encode using token + if (pResolvedToken->pTypeSpec != NULL) + return mdTokenNil; + unsigned methodToken = pResolvedToken->token; switch (TypeFromToken(methodToken))