Add typeInfo::GetMehtod2 to avoid checking GetType == TI_METHOD.
authorSejong OH <sejooh@microsoft.com>
Mon, 16 May 2016 22:42:07 +0000 (15:42 -0700)
committerSejong OH <sejooh@microsoft.com>
Tue, 17 May 2016 18:18:26 +0000 (11:18 -0700)
If FEATURE_CORECLR is enabled, the pointer type is not known to be a method pointer type when GetMethod is called in the importer.

Commit migrated from https://github.com/dotnet/coreclr/commit/5e664c56ec991b9d73a00a0628e114d0c2b0dfec

src/coreclr/src/jit/_typeinfo.h [changed mode: 0644->0755]
src/coreclr/src/jit/importer.cpp [changed mode: 0644->0755]
src/coreclr/tests/testsUnsupportedOutsideWindows.txt

old mode 100644 (file)
new mode 100755 (executable)
index c71294a..2e04343
@@ -555,6 +555,13 @@ public:
         return m_method;
     }
 
+    // If FEATURE_CORECLR is enabled, GetMethod can be called
+    // before the pointer type is known to be a method pointer type.
+    CORINFO_METHOD_HANDLE GetMethod2()  const
+    {
+        return m_method;
+    }    
+    
     // Get this item's type
     // If primitive, returns the primitive type (TI_*)
     // If not primitive, returns:
old mode 100644 (file)
new mode 100755 (executable)
index 52604b5..52a7a71
@@ -11610,7 +11610,7 @@ DO_LDFTN:
 #ifdef FEATURE_CORECLR
                 // In coreclr the delegate transparency rule needs to be enforced even if verification is disabled
                 typeInfo tiActualFtn = impStackTop(0).seTypeInfo;
-                CORINFO_METHOD_HANDLE delegateMethodHandle = tiActualFtn.GetMethod();
+                CORINFO_METHOD_HANDLE delegateMethodHandle = tiActualFtn.GetMethod2();
                             
                 impInsertCalloutForDelegate(info.compMethodHnd,
                                             delegateMethodHandle,
index 845cf60..8e28953 100644 (file)
@@ -219,8 +219,6 @@ JIT/Methodical/cctor/xassem/xprecise3_cs_do/xprecise3_cs_do.sh
 JIT/Methodical/cctor/xassem/xprecise3_cs_r/xprecise3_cs_r.sh
 JIT/Methodical/cctor/xassem/xprecise3_cs_ro/xprecise3_cs_ro.sh
 JIT/Methodical/Coverage/arglist_pos/arglist_pos.sh
-JIT/Methodical/delegate/_simpleoddpower_il_d/_simpleoddpower_il_d.sh
-JIT/Methodical/delegate/_simpleoddpower_il_r/_simpleoddpower_il_r.sh
 JIT/Methodical/delegate/_XModuledeleg1_d/_XModuledeleg1_d.sh
 JIT/Methodical/delegate/_XModuledeleg1_do/_XModuledeleg1_do.sh
 JIT/Methodical/delegate/_XModuledeleg1_r/_XModuledeleg1_r.sh