From 65680b1dab9ca90c9d09fab8d7fe93f0d6d1c3b2 Mon Sep 17 00:00:00 2001 From: Pat Gavlin Date: Tue, 25 Jul 2017 19:02:50 -0700 Subject: [PATCH] Only set flags on a cpBlk source if it is an indir. Just what it says on the tin. Fixes #12907. --- src/jit/morph.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/jit/morph.cpp b/src/jit/morph.cpp index f428ea4..8cead02 100644 --- a/src/jit/morph.cpp +++ b/src/jit/morph.cpp @@ -9053,13 +9053,14 @@ GenTreePtr Compiler::fgMorphOneAsgBlockOp(GenTreePtr tree) } } } - // If we have no information about the src, we have to assume it could - // live anywhere (not just in the GC heap). - // Mark the GT_IND node so that we use the correct write barrier helper in case - // the field is a GC ref. - if (!fgIsIndirOfAddrOfLocal(src)) + if (src->OperIsIndir() && !fgIsIndirOfAddrOfLocal(src)) { + // If we have no information about the src, we have to assume it could + // live anywhere (not just in the GC heap). + // Mark the GT_IND node so that we use the correct write barrier helper in case + // the field is a GC ref. + src->gtFlags |= (GTF_EXCEPT | GTF_GLOB_REF | GTF_IND_TGTANYWHERE); } } -- 2.7.4