Merge pull request #3352 from alexanderkyte/mini_bitcode_fix
authorAlexander Kyte <alexmkyte@gmail.com>
Wed, 3 Aug 2016 17:35:21 +0000 (13:35 -0400)
committerGitHub <noreply@github.com>
Wed, 3 Aug 2016 17:35:21 +0000 (13:35 -0400)
[runtime] Provide Mono.Simd.dll to llvmonlycheck+fullaotcheck

mcs/class/System/System.Net.Mail/SmtpClient.cs
mcs/mcs/ecore.cs
mcs/tests/gtest-637.cs [new file with mode: 0644]
mcs/tests/ver-il-net_4_x.xml
mono/metadata/threads.c
mono/mini/mini-arm.c

index ff881b00bcc9a6df8a457c16e23d134a2ebcef16..ca658c23d752345e3bbd9f5e7f6fa6434ae1f7ca 100644 (file)
@@ -71,6 +71,7 @@ namespace System.Net.Mail {
                ICredentialsByHost credentials;
                string pickupDirectoryLocation;
                SmtpDeliveryMethod deliveryMethod;
+               SmtpDeliveryFormat deliveryFormat;
                bool enableSsl;
 #if SECURITY_DEP               
                X509CertificateCollection clientCertificates;
@@ -223,7 +224,15 @@ namespace System.Net.Mail {
                                port = value;
                        }
                }
-
+               
+               public SmtpDeliveryFormat DeliveryFormat {
+                       get { return deliveryFormat; }
+                       set {
+                               CheckState ();
+                               deliveryFormat = value;
+                       }
+               }
+               
                [MonoTODO]
                public ServicePoint ServicePoint {
                        get { throw new NotImplementedException (); }
index e0e5b6f4748d3a4f4da983f54eb16973b1859dd8..4386f93115a197fe081f0e882270c59d29b42df2 100644 (file)
@@ -4599,10 +4599,11 @@ namespace Mono.CSharp {
                                return IsBetterConversionTarget (rc, p, q);
                        }
 
+                       var p_orig = p;
                        if (p.IsNullableType) {
                                p = Nullable.NullableInfo.GetUnderlyingType (p);
                                if (!BuiltinTypeSpec.IsPrimitiveTypeOrDecimal (p))
-                                       return 0;
+                                       return BetterTypeConversionImplicitConversion (rc, p_orig, q);
 
                                //
                                // Spec expects implicit conversion check between p and q, q and p
@@ -4615,10 +4616,11 @@ namespace Mono.CSharp {
                                        return 2;
                        }
 
+                       var q_orig = q;
                        if (q.IsNullableType) {
                                q = Nullable.NullableInfo.GetUnderlyingType (q);
                                if (!BuiltinTypeSpec.IsPrimitiveTypeOrDecimal (q))
-                                       return 0;
+                                       return BetterTypeConversionImplicitConversion (rc, p_orig, q_orig);
 
                                if (q == p)
                                        return 1;
@@ -4699,12 +4701,17 @@ namespace Mono.CSharp {
                                break;
                        }
 
+                       return BetterTypeConversionImplicitConversion (ec, p, q);
+               }
+
+               static int BetterTypeConversionImplicitConversion (ResolveContext rc, TypeSpec p, TypeSpec q)
+               {
                        // TODO: this is expensive
                        Expression p_tmp = new EmptyExpression (p);
                        Expression q_tmp = new EmptyExpression (q);
 
-                       bool p_to_q = Convert.ImplicitConversionExists (ec, p_tmp, q);
-                       bool q_to_p = Convert.ImplicitConversionExists (ec, q_tmp, p);
+                       bool p_to_q = Convert.ImplicitConversionExists (rc, p_tmp, q);
+                       bool q_to_p = Convert.ImplicitConversionExists (rc, q_tmp, p);
 
                        if (p_to_q && !q_to_p)
                                return 1;
diff --git a/mcs/tests/gtest-637.cs b/mcs/tests/gtest-637.cs
new file mode 100644 (file)
index 0000000..f08c850
--- /dev/null
@@ -0,0 +1,26 @@
+using System;
+
+public struct nint
+{
+       public static implicit operator nint (int v)
+       {
+               return 0;
+       }
+}
+
+public class MainClass 
+{
+       static void Test (string key, int? value)
+       {
+       }
+
+       static void Test (string key, nint? value)
+       {
+               throw new ApplicationException ();
+       }
+
+       public static void Main ()
+       {
+               Test (null, int.MinValue);
+       }
+}
index 79e1b18bf10b992f0e7b5578a81fb54ac33b8a94..c705efa9a031fbfcd360998fccab5c8d635e52ed 100644 (file)
       </method>
     </type>
   </test>
+  <test name="gtest-637.cs">
+    <type name="nint">
+      <method name="nint op_Implicit(Int32)" attrs="2198">
+        <size>15</size>
+      </method>
+    </type>
+    <type name="MainClass">
+      <method name="Void Test(System.String, System.Nullable`1[System.Int32])" attrs="145">
+        <size>2</size>
+      </method>
+      <method name="Void Test(System.String, System.Nullable`1[nint])" attrs="145">
+        <size>7</size>
+      </method>
+      <method name="Void Main()" attrs="150">
+        <size>18</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="gtest-anontype-01.cs">
     <type name="Test">
       <method name="Int32 Main()" attrs="150">
index 017a60f141c8ce4d17b441cf6513647b633638e9..9b2a401567e5823aa95dc7f96e4fecf9af70db9c 100644 (file)
@@ -386,6 +386,18 @@ unlock_thread (MonoInternalThread *thread)
        mono_coop_mutex_unlock (thread->synch_cs);
 }
 
+static inline gboolean
+is_appdomainunloaded_exception (MonoClass *klass)
+{
+       return klass == mono_class_get_appdomain_unloaded_exception_class ();
+}
+
+static inline gboolean
+is_threadabort_exception (MonoClass *klass)
+{
+       return klass == mono_defaults.threadabortexception_class;
+}
+
 /*
  * NOTE: this function can be called also for threads different from the current one:
  * make sure no code called from it will ever assume it is run on the thread that is
@@ -748,7 +760,11 @@ static guint32 WINAPI start_wrapper_internal(void *data)
 
                if (!mono_error_ok (&error)) {
                        MonoException *ex = mono_error_convert_to_exception (&error);
-                       if (ex) {
+
+                       g_assert (ex != NULL);
+                       MonoClass *klass = mono_object_get_class (&ex->object);
+                       if ((mono_runtime_unhandled_exception_policy_get () != MONO_UNHANDLED_POLICY_LEGACY) &&
+                           !is_threadabort_exception (klass)) {
                                mono_unhandled_exception (&ex->object);
                                mono_invoke_unhandled_exception_hook (&ex->object);
                                g_assert_not_reached ();
@@ -1112,7 +1128,7 @@ mono_thread_detach_if_exiting (void)
 }
 
 void
-mono_thread_exit ()
+mono_thread_exit (void)
 {
        MonoInternalThread *thread = mono_thread_internal_current ();
 
@@ -5050,18 +5066,6 @@ mono_thread_internal_check_for_interruption_critical (MonoInternalThread *thread
                mono_thread_interruption_checkpoint ();
 }
 
-static inline gboolean
-is_appdomainunloaded_exception (MonoClass *klass)
-{
-       return klass == mono_class_get_appdomain_unloaded_exception_class ();
-}
-
-static inline gboolean
-is_threadabort_exception (MonoClass *klass)
-{
-       return klass == mono_defaults.threadabortexception_class;
-}
-
 void
 mono_thread_internal_unhandled_exception (MonoObject* exc)
 {
index d4262ab7d2f29ce023aacec66b642392877dcf0a..8b48bc98fd3e95aedc60133921e5a72ee42fed28 100644 (file)
@@ -833,7 +833,8 @@ mono_arch_init (void)
 
        mono_os_mutex_init_recursive (&mini_arch_mutex);
        if (mini_get_debug_options ()->soft_breakpoints) {
-               breakpoint_tramp = mini_get_breakpoint_trampoline ();
+               if (!mono_aot_only)
+                       breakpoint_tramp = mini_get_breakpoint_trampoline ();
        } else {
                ss_trigger_page = mono_valloc (NULL, mono_pagesize (), MONO_MMAP_READ|MONO_MMAP_32BIT);
                bp_trigger_page = mono_valloc (NULL, mono_pagesize (), MONO_MMAP_READ|MONO_MMAP_32BIT);
@@ -7203,6 +7204,9 @@ mono_arch_set_breakpoint (MonoJitInfo *ji, guint8 *ip)
        if (ji->from_aot) {
                SeqPointInfo *info = mono_arch_get_seq_point_info (mono_domain_get (), ji->code_start);
 
+               if (!breakpoint_tramp)
+                       breakpoint_tramp = mini_get_breakpoint_trampoline ();
+
                g_assert (native_offset % 4 == 0);
                g_assert (info->bp_addrs [native_offset / 4] == 0);
                info->bp_addrs [native_offset / 4] = opt->soft_breakpoints ? breakpoint_tramp : bp_trigger_page;
@@ -7249,6 +7253,9 @@ mono_arch_clear_breakpoint (MonoJitInfo *ji, guint8 *ip)
                guint32 native_offset = ip - (guint8*)ji->code_start;
                SeqPointInfo *info = mono_arch_get_seq_point_info (mono_domain_get (), ji->code_start);
 
+               if (!breakpoint_tramp)
+                       breakpoint_tramp = mini_get_breakpoint_trampoline ();
+
                g_assert (native_offset % 4 == 0);
                g_assert (info->bp_addrs [native_offset / 4] == (opt->soft_breakpoints ? breakpoint_tramp : bp_trigger_page));
                info->bp_addrs [native_offset / 4] = 0;