Merge pull request #3832 from microMolvi/patch-2
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Wed, 26 Oct 2016 22:30:23 +0000 (00:30 +0200)
committerGitHub <noreply@github.com>
Wed, 26 Oct 2016 22:30:23 +0000 (00:30 +0200)
cccheck.1: fix a typo

mono/mini/aot-compiler.c
mono/tests/generic-stack-traces.2.cs

index 10d8563de72eab2de768386203ea7dddeb261e56..57835f473e99bd8bc58fd389046140d2bad1e775 100644 (file)
@@ -326,6 +326,9 @@ get_unwind_info_offset (MonoAotCompile *acfg, guint8 *encoded, guint32 encoded_l
 static char*
 get_plt_entry_debug_sym (MonoAotCompile *acfg, MonoJumpInfo *ji, GHashTable *cache);
 
+static void
+add_gsharedvt_wrappers (MonoAotCompile *acfg, MonoMethodSignature *sig, gboolean gsharedvt_in, gboolean gsharedvt_out);
+
 static void
 aot_printf (MonoAotCompile *acfg, const gchar *format, ...)
 {
@@ -4133,6 +4136,13 @@ add_wrappers (MonoAotCompile *acfg)
                        (method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL)) {
                        add_method (acfg, mono_marshal_get_native_wrapper (method, TRUE, TRUE));
                }
+
+               if (method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) {
+                       if (acfg->aot_opts.llvm_only) {
+                               /* The wrappers have a different signature (hasthis is not set) so need to add this too */
+                               add_gsharedvt_wrappers (acfg, mono_method_signature (method), FALSE, TRUE);
+                       }
+               }
        }
  
        /* native-to-managed wrappers */
index 340b28f2678511b1bba7f8a9aadc9fac4502e3c5..499cf9e8d0075fb7e82282a5fd2fa29de18eb3d3 100644 (file)
@@ -38,6 +38,8 @@ public class main {
        for (int i = 0; i < st.FrameCount; ++i) {
            StackFrame sf = st.GetFrame (i);
            MethodBase m = sf.GetMethod ();
+               if (m == null)
+                       continue;
            Type t = m.DeclaringType;
            if (m.IsGenericMethod) {
                Type[] margs = m.GetGenericArguments ();