Merge pull request #5656 from lateralusX/lateralusX/dynamic-static-windows-build
authorJohan Lorensson <lateralusx.github@gmail.com>
Tue, 3 Oct 2017 12:20:14 +0000 (14:20 +0200)
committerGitHub <noreply@github.com>
Tue, 3 Oct 2017 12:20:14 +0000 (14:20 +0200)
[Windows] Mono build project restructure dropping .def file enabling full static and dynamic mono builds.

mcs/mcs/ecore.cs
mcs/tests/test-ref-06.cs [new file with mode: 0644]
mcs/tests/ver-il-net_4_x.xml
mono/metadata/class-internals.h
mono/mini/iltests.il
mono/mini/interp/transform.c
mono/mini/method-to-ir.c

index 490bcfb518e5c4a78535f71c07bc2e6c8dde9ce4..34ff9a30dab3cb423f4b9f64b7a7640d67a2b56a 100644 (file)
@@ -7394,6 +7394,11 @@ namespace Mono.CSharp {
                                if (ResolveAutopropertyAssignment (rc, right_side))
                                        return this;
 
+                               if (best_candidate.MemberType.Kind == MemberKind.ByRef) {
+                                       getter = CandidateToBaseOverride (rc, best_candidate.Get);
+                                       return ByRefDereference.Create(this).Resolve(rc);
+                               }
+
                                rc.Report.Error (200, loc, "Property or indexer `{0}' cannot be assigned to (it is read-only)",
                                        GetSignatureForError ());
                                return null;
diff --git a/mcs/tests/test-ref-06.cs b/mcs/tests/test-ref-06.cs
new file mode 100644 (file)
index 0000000..74d35f4
--- /dev/null
@@ -0,0 +1,24 @@
+using System;
+
+class X
+{
+       public static int Main ()
+       {
+               var x = new X ();
+               x [0] = 3;
+               if (x.field != 3)
+                       return 1;
+               x.Prop = 5;
+               if (x.field != 5)
+                       return 2;
+
+               return 0;
+       }
+
+       int field;
+
+       ref int this [int idx] => ref field;
+
+       ref int Prop => ref field;
+
+}
\ No newline at end of file
index b111a7e3c5a7ecf197d9e44d133978ad86c83303..16a62d1ce87d50337879aadbe40bed7a49913d54 100644 (file)
       </method>
     </type>
   </test>
+  <test name="test-ref-06.cs">
+    <type name="X">
+      <method name="Int32 Main()" attrs="150">
+        <size>71</size>
+      </method>
+      <method name="Int32&amp; get_Item(Int32)" attrs="2177">
+        <size>14</size>
+      </method>
+      <method name="Int32&amp; get_Prop()" attrs="2177">
+        <size>14</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="test-static-using-01.cs">
     <type name="A.B.X">
       <method name="Int32 Test()" attrs="150">
index e3d9e18741752ec88e7136cda18776ea7d25c736..ed4190372cd80e57d5c04efc2927a0a40ba588ae 100644 (file)
@@ -111,7 +111,7 @@ struct _MonoMethodPInvoke {
        gpointer addr;
        /* add marshal info */
        guint16 piflags;  /* pinvoke flags */
-       guint16 implmap_idx;  /* index into IMPLMAP */
+       guint32 implmap_idx;  /* index into IMPLMAP */
 };
 
 /* 
index 30419d9178a1397dfea214d7105bf364b2f8363a..1bc5a2cf720e6ea557da34f5fc621c3d13875b96 100644 (file)
@@ -3091,4 +3091,15 @@ L_3:
     IL_000c:  ret
   }
 
+  .method public hidebysig static int32 test_104_conv_u_and_string() cil managed
+  {
+    .maxstack  8
+       ldstr "hello"
+       conv.u
+       call int32 [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::get_OffsetToStringData()
+       add
+       ldind.u2
+       ret
+  }
+
 }
index 1868eb62c1024e74b43f95dd60d3930562ba25b5..0bdb158053412048eeb49db2387fdf86f22fbfb1 100644 (file)
@@ -2503,6 +2503,7 @@ generate (MonoMethod *method, InterpMethod *rtm, unsigned char *is_bb_start, Mon
 #endif
                                break;
                        case STACK_TYPE_MP:
+                       case STACK_TYPE_O:
                                break;
                        default:
                                g_assert_not_reached ();
index ce326f3c2d3443d3461073d826215663523955e4..54e8c3580bf1ac6270c750908ad59a82b1165102 100644 (file)
@@ -1070,6 +1070,7 @@ type_from_op (MonoCompile *cfg, MonoInst *ins, MonoInst *src1, MonoInst *src2)
                        break;
                case STACK_PTR:
                case STACK_MP:
+               case STACK_OBJ:
 #if SIZEOF_VOID_P == 8
                        ins->opcode = OP_LCONV_TO_U;
 #else