Skip to content

Commit

Permalink
Added byref types so they work with constrained callvirt.
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesbetros committed Mar 24, 2016
1 parent 83ad5f3 commit 89d0217
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions source/Cosmos.IL2CPU/IL/Callvirt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,12 @@ public static void DoExecute(Cosmos.Assembler.Assembler Assembler, MethodInfo aM
* $esp + mThisOffset This
*/
Type xPopType = aOp.StackPopTypes[0];
if (xPopType.HasElementType)
if ((xPopType.IsPointer || xPopType.IsByRef) && typeof(ValueType).IsAssignableFrom(xPopType.GetElementType()))
{
xPopType = xPopType.GetElementType();
}
if ((typeof(ValueType).IsAssignableFrom(xPopType)) && (!xPopType.IsPrimitive))
{
string xTypeId = GetTypeIDLabel(xPopType);
new CPUx86.Push { DestinationRef = Cosmos.Assembler.ElementReference.New(xTypeId), DestinationIsIndirect = true };

}
else
{
Expand Down

0 comments on commit 89d0217

Please sign in to comment.