Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 2008454

Browse files
Merge pull request #6889 from JosephTremoulet/StaticField
Fix IMGREL32 static field addr value-num blindspot
2 parents 2448e08 + e4cb4dd commit 2008454

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

src/jit/gentree.cpp

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15718,19 +15718,23 @@ bool GenTree::IsFieldAddr(Compiler* comp, GenTreePtr* pObj, GenTreePtr* pStatic,
1571815718
baseAddr = gtOp.gtOp1;
1571915719
}
1572015720
}
15721+
// Check if "this" has a zero-offset annotation.
15722+
else if (comp->GetZeroOffsetFieldMap()->Lookup(this, &newFldSeq))
15723+
{
15724+
baseAddr = this;
15725+
mustBeStatic = true;
15726+
}
15727+
else if (OperGet() == GT_CNS_INT && gtIntCon.gtFieldSeq != nullptr)
15728+
{
15729+
// Address is a literal constant; must be a static field.
15730+
newFldSeq = gtIntCon.gtFieldSeq;
15731+
baseAddr = this;
15732+
mustBeStatic = true;
15733+
}
1572115734
else
1572215735
{
15723-
// Check if "this" has a zero-offset annotation.
15724-
if (!comp->GetZeroOffsetFieldMap()->Lookup(this, &newFldSeq))
15725-
{
15726-
// If not, this is not a field address.
15727-
return false;
15728-
}
15729-
else
15730-
{
15731-
baseAddr = this;
15732-
mustBeStatic = true;
15733-
}
15736+
// This is not a field address.
15737+
return false;
1573415738
}
1573515739

1573615740
// If not we don't have a field seq, it's not a field address.

tests/src/GC/Scenarios/FinalizeTimeout/FinalizeTimeout.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ private static void ThreadMain()
4747

4848
private class BlockingFinalizerOnShutdown
4949
{
50-
public static bool finalizerCompletedOnce = false;
50+
public volatile static bool finalizerCompletedOnce = false;
5151
public bool isLastObject = false;
5252

5353
~BlockingFinalizerOnShutdown()

0 commit comments

Comments
 (0)