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.
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)