diff --git a/src/jit/gentree.cpp b/src/jit/gentree.cpp index d97e67d58fe2..9d717fb5ccdc 100644 --- a/src/jit/gentree.cpp +++ b/src/jit/gentree.cpp @@ -15789,23 +15789,19 @@ bool GenTree::IsFieldAddr(Compiler* comp, GenTreePtr* pObj, GenTreePtr* pStatic, baseAddr = gtOp.gtOp1; } } - // Check if "this" has a zero-offset annotation. - else if (comp->GetZeroOffsetFieldMap()->Lookup(this, &newFldSeq)) - { - baseAddr = this; - mustBeStatic = true; - } - else if (OperGet() == GT_CNS_INT && gtIntCon.gtFieldSeq != nullptr) - { - // Address is a literal constant; must be a static field. - newFldSeq = gtIntCon.gtFieldSeq; - baseAddr = this; - mustBeStatic = true; - } else { - // This is not a field address. - return false; + // Check if "this" has a zero-offset annotation. + if (!comp->GetZeroOffsetFieldMap()->Lookup(this, &newFldSeq)) + { + // If not, this is not a field address. + return false; + } + else + { + baseAddr = this; + mustBeStatic = true; + } } // If not we don't have a field seq, it's not a field address. diff --git a/tests/src/GC/Scenarios/FinalizeTimeout/FinalizeTimeout.cs b/tests/src/GC/Scenarios/FinalizeTimeout/FinalizeTimeout.cs index 0935b4524f7f..0fda8172e49f 100644 --- a/tests/src/GC/Scenarios/FinalizeTimeout/FinalizeTimeout.cs +++ b/tests/src/GC/Scenarios/FinalizeTimeout/FinalizeTimeout.cs @@ -47,7 +47,7 @@ private static void ThreadMain() private class BlockingFinalizerOnShutdown { - public volatile static bool finalizerCompletedOnce = false; + public static bool finalizerCompletedOnce = false; public bool isLastObject = false; ~BlockingFinalizerOnShutdown()