From: Brian Sullivan Date: Fri, 7 Aug 2020 18:08:34 +0000 (-0700) Subject: Fix Issue #877 - Use GT_OBJ when copying a struct (#40483) X-Git-Tag: submit/tizen/20210909.063632~6146 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5ebf5867c29f3d053b74561e119853b33dfeea9a;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Fix Issue #877 - Use GT_OBJ when copying a struct (#40483) --- diff --git a/src/coreclr/src/jit/morph.cpp b/src/coreclr/src/jit/morph.cpp index 61ad993..8134272 100644 --- a/src/coreclr/src/jit/morph.cpp +++ b/src/coreclr/src/jit/morph.cpp @@ -5742,7 +5742,9 @@ GenTree* Compiler::fgMorphStackArgForVarArgs(unsigned lclNum, var_types varType, GenTree* tree; if (varTypeIsStruct(varType)) { - tree = new (this, GT_BLK) GenTreeBlk(GT_BLK, TYP_STRUCT, ptrArg, typGetBlkLayout(varDsc->lvExactSize)); + CORINFO_CLASS_HANDLE typeHnd = varDsc->lvVerTypeInfo.GetClassHandle(); + assert(typeHnd != nullptr); + tree = gtNewObjNode(typeHnd, ptrArg); } else {