提交 b29264cd 编写于 作者: M Marek Safar

Use 2 phase dynamic load only for compound operations

上级 b8c0561d
......@@ -8084,7 +8084,7 @@ namespace Mono.CSharp {
// Same cannot be done for reference type because array covariance and the
// check in ldelema requires to specify the type of array element stored at the index
//
if (t.IsStruct && (prepare_for_load || !TypeManager.IsPrimitiveType (t)) && !(source is DynamicExpressionStatement)) {
if (t.IsStruct && ((prepare_for_load && !(source is DynamicExpressionStatement)) || !TypeManager.IsPrimitiveType (t))) {
LoadArrayAndArguments (ec);
ec.EmitArrayAddress (ac);
......
......@@ -66,6 +66,12 @@ public class Test
iar [0] += dvalue;
if (iar [0] != -11)
return 5;
dynamic dn = 1;
int?[] array = new int?[1];
array[0] = dn;
if (array [0] != 1)
return 6;
Console.WriteLine ("ok");
return 0;
......
......@@ -2276,7 +2276,7 @@
<size>74</size>
</method>
<method name="Int32 Main()">
<size>1039</size>
<size>1181</size>
</method>
<method name="Void .ctor()">
<size>18</size>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册