Skip to content
Permalink
Browse files

Combined interface and class check.

  • Loading branch information...
disks86 committed Jun 5, 2019
1 parent 01ba26b commit d8b22c7a965c1904427da6c06e64bbe9677364b9
Showing with 6 additions and 12 deletions.
  1. +6 −12 source/Cosmos.IL2CPU/ILOpCodes/OpBranch.cs
@@ -176,18 +176,12 @@ protected override void DoInterpretStackTypes(ref bool aSituationChanged)
|| (xValue1 == typeof(bool) && xValue2 == typeof(int)))
{
return;
}

if (xValue1.IsClass &&
xValue2.IsClass)
{
return;
}

if (xValue1.IsInterface && xValue1.IsAssignableFrom(xValue2) ||
xValue2.IsInterface && xValue2.IsAssignableFrom(xValue1))
{
return;
}

if ((xValue1.IsClass || xValue1.IsInterface)
&& (xValue2.IsClass || xValue2.IsInterface))
{
return;
}

throw new Exception(String.Format("Comparing types '{0}' and '{1}' not supported!", xValue1.AssemblyQualifiedName, xValue2.AssemblyQualifiedName));

0 comments on commit d8b22c7

Please sign in to comment.
You can’t perform that action at this time.