summaryrefslogtreecommitdiff
path: root/src/jit
diff options
context:
space:
mode:
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>2019-06-24 16:00:29 +0200
committerJan Kotas <jkotas@microsoft.com>2019-06-24 07:00:29 -0700
commit2fe1a39d63f5e5e131ed894dd44948e9b05430c9 (patch)
treee2a9aaa1b0bc2b4f4aa9ce799af76dcd58505bf2 /src/jit
parentd58a283f2a69da1509b8d76dfec0959b93e061c8 (diff)
downloadcoreclr-2fe1a39d63f5e5e131ed894dd44948e9b05430c9.tar.gz
coreclr-2fe1a39d63f5e5e131ed894dd44948e9b05430c9.tar.bz2
coreclr-2fe1a39d63f5e5e131ed894dd44948e9b05430c9.zip
Extend the assert for zero-offset fields (#25341)
CoreRT has an [actual field](https://github.com/dotnet/corert/blob/ba3ba929c88bd80ec5d4dd9cf6917471ad8fa180/src/System.Private.CoreLib/src/System/Object.CoreRT.cs#L30) for the method table table pointer in `System.Object`. CoreCLR does shenanigans when laying out `System.Object` to leave a pointer-sized hole instead. I think the zero-offset field is triggering these asserts.
Diffstat (limited to 'src/jit')
-rw-r--r--src/jit/morph.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/jit/morph.cpp b/src/jit/morph.cpp
index 610bd17805..c087fb069f 100644
--- a/src/jit/morph.cpp
+++ b/src/jit/morph.cpp
@@ -6655,7 +6655,7 @@ GenTree* Compiler::fgMorphField(GenTree* tree, MorphAddrContext* mac)
#endif
// We expect 'addr' to be an address at this point.
- assert(addr->TypeGet() == TYP_BYREF || addr->TypeGet() == TYP_I_IMPL);
+ assert(addr->TypeGet() == TYP_BYREF || addr->TypeGet() == TYP_I_IMPL || addr->TypeGet() == TYP_REF);
// Since we don't make a constant zero to attach the field sequence to, associate it with the "addr" node.
FieldSeqNode* fieldSeq =
@@ -18724,7 +18724,7 @@ private:
void Compiler::fgAddFieldSeqForZeroOffset(GenTree* addr, FieldSeqNode* fieldSeqZero)
{
// We expect 'addr' to be an address at this point.
- assert(addr->TypeGet() == TYP_BYREF || addr->TypeGet() == TYP_I_IMPL);
+ assert(addr->TypeGet() == TYP_BYREF || addr->TypeGet() == TYP_I_IMPL || addr->TypeGet() == TYP_REF);
FieldSeqNode* fieldSeqUpdate = fieldSeqZero;
GenTree* fieldSeqNode = addr;