From 8169e76df6f490cf40999c9ae51531c011cf3a63 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Strehovsk=C3=BD?= Date: Wed, 1 Mar 2017 22:15:34 -0800 Subject: [PATCH] Use the correct class handle for fat call temporary (dotnet/coreclr#9893) `clsHnd` is the class handle of the type that owns the method for `opcode != CEE_CALLI`. We need the class handle for the method's return type though. This is ending up with RyuJIT asking weird questions over JitInterface (`getClassGClayout` of a reference type). Also removing a line that was added in dotnet/coreclr#9191 to support the old code. Commit migrated from https://github.com/dotnet/coreclr/commit/58010850217463943ba5910ddc8303b9d36f709e --- src/coreclr/src/jit/importer.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/coreclr/src/jit/importer.cpp b/src/coreclr/src/jit/importer.cpp index adc06b2..4038a18 100644 --- a/src/coreclr/src/jit/importer.cpp +++ b/src/coreclr/src/jit/importer.cpp @@ -6432,7 +6432,6 @@ var_types Compiler::impImportCall(OPCODE opcode, eeGetSig(pResolvedToken->token, info.compScopeHnd, impTokenLookupContextHandle, &calliSig); callRetTyp = JITtype2varType(calliSig.retType); - clsHnd = calliSig.retTypeClass; call = impImportIndirectCall(&calliSig, ilOffset); @@ -7715,7 +7714,7 @@ DONE_CALL: unsigned calliSlot = lvaGrabTemp(true DEBUGARG("calli")); LclVarDsc* varDsc = &lvaTable[calliSlot]; varDsc->lvVerTypeInfo = tiRetVal; - impAssignTempGen(calliSlot, call, clsHnd, (unsigned)CHECK_SPILL_NONE); + impAssignTempGen(calliSlot, call, tiRetVal.GetClassHandle(), (unsigned)CHECK_SPILL_NONE); // impAssignTempGen can change src arg list and return type for call that returns struct. var_types type = genActualType(lvaTable[calliSlot].TypeGet()); call = gtNewLclvNode(calliSlot, type); -- 2.7.4