From: Pat Gavlin Date: Wed, 26 Jul 2017 01:15:40 +0000 (-0700) Subject: Do not get the GC layout for small structs in legacy backend. X-Git-Tag: accepted/tizen/base/20180629.140029~1083^2~64^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d498ad1247c2ffa6aa3ae4584ec71f08dedd0528;p=platform%2Fupstream%2Fcoreclr.git Do not get the GC layout for small structs in legacy backend. Such structs are too small to contain any GC pointers. Synthesize a GC layout with a single slot of `TYPE_GC_NONE`. Fixes VSO 469600. --- diff --git a/src/jit/codegenlegacy.cpp b/src/jit/codegenlegacy.cpp index e82faf6..acb9c93 100644 --- a/src/jit/codegenlegacy.cpp +++ b/src/jit/codegenlegacy.cpp @@ -17693,7 +17693,16 @@ void CodeGen::SetupLateArgs(GenTreeCall* call) getEmitter()->emitIns_R_S(INS_lea, EA_PTRSIZE, regSrc, varNum, 0); regTracker.rsTrackRegTrash(regSrc); - gcLayout = compiler->lvaGetGcLayout(varNum); + + if (varDsc->lvExactSize >= TARGET_POINTER_SIZE) + { + gcLayout = compiler->lvaGetGcLayout(varNum); + } + else + { + gcLayout = new (compiler, CMK_Codegen) BYTE[1]; + gcLayout[0] = TYPE_GC_NONE; + } } } else if (arg->gtOper == GT_MKREFANY)