JIT: simple fix for the tail call stress assert
authorAndy Ayers <andya@microsoft.com>
Sat, 22 Apr 2017 00:09:07 +0000 (17:09 -0700)
committerAndy Ayers <andya@microsoft.com>
Sat, 22 Apr 2017 00:17:28 +0000 (17:17 -0700)
If class handles match, the return types are compatible, no matter
what the jit types indicate.

Addresses #10047.

src/jit/importer.cpp

index 2e3ca81..c954ad5 100644 (file)
@@ -6216,6 +6216,12 @@ bool Compiler::impTailCallRetTypeCompatible(var_types            callerRetType,
         return true;
     }
 
+    // If the class handles are the same and not null, the return types are compatible.
+    if ((callerRetTypeClass != nullptr) && (callerRetTypeClass == calleeRetTypeClass))
+    {
+        return true;
+    }
+
 #if defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_)
     // Jit64 compat:
     if (callerRetType == TYP_VOID)