Skip to content

Commit 7d01147

Browse files
committed
t
1 parent fd6a99e commit 7d01147

4 files changed

Lines changed: 35 additions & 6 deletions

File tree

CLRSharp/CLRSharp/CLRSharp_Env.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public string version
1111
{
1212
get
1313
{
14-
return "0.42.7Beta";
14+
return "0.43Beta";
1515
}
1616
}
1717
public ICLRSharp_Logger logger

CLRSharp/CLRSharp/Execute/StackFrame.cs

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,15 @@ void FillArray(object array, byte[] bytes)
312312
arr[i] = BitConverter.ToDouble(bytes, i * step);
313313
}
314314
}
315+
else if (array is bool[])
316+
{
317+
int step = 1;
318+
bool[] arr = array as bool[];
319+
for (int i = 0; i < bytes.Length / step; i++)
320+
{
321+
arr[i] = BitConverter.ToBoolean(bytes, i * step);
322+
}
323+
}
315324
else
316325
{
317326
throw new NotImplementedException("array=" + array.GetType());
@@ -493,10 +502,24 @@ public void Box(ICLRType type)
493502
else ev = (int)obj;
494503
obj = Enum.ToObject(type.TypeForSystem, ev);
495504
}
496-
else
505+
else
497506
{
498507
if (box != null)
499-
obj = box.BoxDefine();
508+
{
509+
var tcode = ValueOnStack.GetTypeCode(type.TypeForSystem);
510+
if (tcode == box.type)
511+
{
512+
513+
514+
obj = box.BoxDefine();
515+
}
516+
else
517+
{
518+
var nbox = new VBox(box.typeStack, tcode);
519+
nbox.Set(box);
520+
obj = nbox.BoxDefine();
521+
}
522+
}
500523
}
501524
stackCalc.Push(obj);
502525
_codepos++;

UnitTestDll/Test_ByDuskforest.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,26 @@ class Test_ByDuskforest
1212
public static void UnitTest_Bool2Object()
1313
{
1414
TestClass.TestObjectArg(true);
15+
//fixed
1516
}
1617

1718
public static void UnitTest_Int2Byte()
1819
{
1920
TestClass.TestByteArg(32);
21+
//no error
2022
}
21-
2223
public static void UnitTest_CtorWithNoArg()
2324
{
2425
//这行代码放在Program.cs里面执行是不会报错的
25-
System.Activator.CreateInstance(Type.GetType("TestClass"));
26+
System.Activator.CreateInstance(Type.GetType("TestClass,UnitTest"));
27+
//error assm
2628
}
2729

2830
public static void UnitTest_CtorWithByteArg()
2931
{
3032
//这行代码放在Program.cs里面执行是不会报错的
31-
System.Activator.CreateInstance(Type.GetType("TestClass"), new Object[] { (byte)32 });
33+
System.Activator.CreateInstance(Type.GetType("TestClass,UnitTest"), new Object[] { (byte)32 });
34+
//error assm
3235
}
3336
}
3437
}

readme.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
用途,Unity3D热更(包括IOS平台)等
66
Beta阶段,有一定动手能力的小伙伴,已经可以将它用于实战
77
更新日志:
8+
2015-03-30 V0.43Beta
9+
修正 bool[] init
10+
修正 box on convert
811
2015-03-19 V0.42.7Beta
912
修正a[1]++ 这种计算的Bug
1013
2015-03-16 V0.42.6Beta

0 commit comments

Comments
 (0)