summaryrefslogtreecommitdiff
path: root/src/jit/gcinfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/jit/gcinfo.cpp')
-rw-r--r--src/jit/gcinfo.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/jit/gcinfo.cpp b/src/jit/gcinfo.cpp
index b64fd0a174..e2f76f3b13 100644
--- a/src/jit/gcinfo.cpp
+++ b/src/jit/gcinfo.cpp
@@ -265,6 +265,12 @@ GCInfo::WriteBarrierForm GCInfo::gcIsWriteBarrierCandidate(GenTreePtr tgt, GenTr
case GT_STOREIND:
#endif // !LEGACY_BACKEND
case GT_IND: /* Could be the managed heap */
+ if (tgt->TypeGet() == TYP_BYREF)
+ {
+ // Byref values cannot be in managed heap.
+ // This case occurs for Span<T>.
+ return WBF_NoBarrier;
+ }
return gcWriteBarrierFormFromTargetAddress(tgt->gtOp.gtOp1);
case GT_LEA: