summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Kulaychuk <igor.kulaychuk@gmail.com>2017-05-22 19:30:40 +0300
committerJan Kotas <jkotas@microsoft.com>2017-05-22 09:30:40 -0700
commit5493b8439dca2ada6e912716e035654b16685bb1 (patch)
tree4d45f6f17b463ea52584f7f27e940a5c69a9d94e
parent3c76c1fff9473f8a0051907453c7e1902a6c3647 (diff)
downloadcoreclr-5493b8439dca2ada6e912716e035654b16685bb1.tar.gz
coreclr-5493b8439dca2ada6e912716e035654b16685bb1.tar.bz2
coreclr-5493b8439dca2ada6e912716e035654b16685bb1.zip
Fix FieldDesc::GetExactFieldType when FieldDesc doesn't exactly represent the owner type (#10941)
* Fix FieldDesc::GetExactFieldType when FieldDesc doesn't exactly represent the owner type To get the exact type from FieldDesc, field signature should point past the calling convention.
-rw-r--r--src/vm/field.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/vm/field.cpp b/src/vm/field.cpp
index 9cdb16f6b9..667e2ac867 100644
--- a/src/vm/field.cpp
+++ b/src/vm/field.cpp
@@ -888,12 +888,15 @@ TypeHandle FieldDesc::GetExactFieldType(TypeHandle owner)
GetSig(&pSig, &cSig);
SigPointer sig(pSig, cSig);
+ ULONG callConv;
+ IfFailThrow(sig.GetCallingConv(&callConv));
+ _ASSERTE(callConv == IMAGE_CEE_CS_CALLCONV_FIELD);
+
// Get the generics information
SigTypeContext sigTypeContext(GetExactClassInstantiation(owner), Instantiation());
- TypeHandle thApproxFieldType = GetApproxFieldTypeHandleThrowing();
// Load the exact type
- RETURN (sig.GetTypeHandleThrowing(thApproxFieldType.GetModule(), &sigTypeContext));
+ RETURN (sig.GetTypeHandleThrowing(GetModule(), &sigTypeContext));
}
}