Skip to content

Commit

Permalink
Fix unboxing handling of Method_Handles (dotnet#52060)
Browse files Browse the repository at this point in the history
* Fix log to flag valuetype methods as requiring [UNBOX]

* Inline unboxing check

* check IsVirtual to flag it as unboxingStub.

* Added comments for clarity.
  • Loading branch information
mangod9 authored Apr 30, 2021
1 parent e7e73c2 commit 6aca7af
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2207,7 +2207,12 @@ private void embedGenericHandle(ref CORINFO_RESOLVED_TOKEN pResolvedToken, bool
TypeDesc td = HandleToObject(pResolvedToken.hClass);

bool unboxingStub = false;
if ((td.IsValueType) && !md.Signature.IsStatic)
//
// This logic should be kept in sync with MethodTableBuilder::NeedsTightlyBoundUnboxingStub
// Essentially all ValueType virtual methods will require an Unboxing Stub
//
if ((td.IsValueType) && !md.Signature.IsStatic
&& md.IsVirtual)
{
unboxingStub = true;
}
Expand Down

0 comments on commit 6aca7af

Please sign in to comment.