* Don't denormalize enum return values on instance methods on x86.
* Reuse closedElemType.
}
else
{
- mtype = sig.PeekElemTypeClosed(pModule, pTypeContext);
+ SigPointer sigtmp = sig;
+ CorElementType closedElemType = sigtmp.PeekElemTypeClosed(pModule, pTypeContext);
+ if (closedElemType == ELEMENT_TYPE_VALUETYPE)
+ {
+ TypeHandle th = sigtmp.GetTypeHandleThrowing(pModule, pTypeContext);
+ // If the return type of an instance method is a value-type we need the actual return type.
+ // However, if the return type is an enum, we can normalize it.
+ if (!th.IsEnum())
+ {
+ mtype = closedElemType;
+ }
+ }
+
}
#endif // _TARGET_X86_