Skip to content

Commit

Permalink
Fixed Ourpalm#319
Browse files Browse the repository at this point in the history
  • Loading branch information
liiir1985 committed Apr 1, 2020
1 parent 2c10dea commit ef7a64b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ILRuntime/Runtime/Enviorment/CLRRedirections.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,12 @@ static object CheckCrossBindingAdapter(object obj)
if (islong)
res = ((List<long>)list).ToArray();
else
res = ((List<int>)list).ToArray();
{
if (list == null)
res = new int[0];
else
res = ((List<int>)list).ToArray();
}
return ILIntepreter.PushObject(ret, mStack, res, true);
}
else
Expand Down
11 changes: 11 additions & 0 deletions TestCases/EnumTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ enum TestEnumSByte : sbyte
Max = sbyte.MaxValue
}

enum TestEnumEmpty
{

}

static TestEnum b = TestEnum.Enum2;

public static string Test01()
Expand Down Expand Up @@ -258,6 +263,12 @@ static void Test18Sub(ulong val, out TestEnum e)
{
e = (TestEnum)val;
}

public static void Test19()
{
Console.WriteLine(Enum.GetValues(typeof(TestEnumEmpty)).Length);
}

class SystemType
{
public int value = 10;
Expand Down
14 changes: 14 additions & 0 deletions TestCases/InheritanceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,20 @@ public static void InheritanceTest11()
sub.Test();
}

static void InheritanceTest12Sub()
{
Console.WriteLine("OK");
}

public static void InheritanceTest12()
{
for(int i = 0; i < 5; i++)
{
System.Type t = typeof(InheritanceTest);
t.GetMethod("InheritanceTest12Sub", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static).Invoke(null, null);
}
}

class TestCls5 : TestClass2
{
public override float AbMethod2(int arg1)
Expand Down

0 comments on commit ef7a64b

Please sign in to comment.