summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Tremoulet <JCTremoulet@gmail.com>2016-09-08 01:04:25 -0400
committerGitHub <noreply@github.com>2016-09-08 01:04:25 -0400
commit200845408154acf072d8079236248c37a7133b24 (patch)
tree01b6c47f129939667298243c14b4ea84e84476ec
parent2448e08eedea49b0c325a60ba567a21883e342fd (diff)
parente4cb4dd894472a9c5efef31e588a9caefd635d24 (diff)
downloadcoreclr-200845408154acf072d8079236248c37a7133b24.tar.gz
coreclr-200845408154acf072d8079236248c37a7133b24.tar.bz2
coreclr-200845408154acf072d8079236248c37a7133b24.zip
Merge pull request #6889 from JosephTremoulet/StaticField
Fix IMGREL32 static field addr value-num blindspot
-rw-r--r--src/jit/gentree.cpp26
-rw-r--r--tests/src/GC/Scenarios/FinalizeTimeout/FinalizeTimeout.cs2
2 files changed, 16 insertions, 12 deletions
diff --git a/src/jit/gentree.cpp b/src/jit/gentree.cpp
index e0b13a43ad..49b6bb32ea 100644
--- a/src/jit/gentree.cpp
+++ b/src/jit/gentree.cpp
@@ -15718,19 +15718,23 @@ 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
{
- // 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;
- }
+ // This is not a field address.
+ return false;
}
// 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 0fda8172e4..0935b4524f 100644
--- a/tests/src/GC/Scenarios/FinalizeTimeout/FinalizeTimeout.cs
+++ b/tests/src/GC/Scenarios/FinalizeTimeout/FinalizeTimeout.cs
@@ -47,7 +47,7 @@ public class FinalizeTimeout
private class BlockingFinalizerOnShutdown
{
- public static bool finalizerCompletedOnce = false;
+ public volatile static bool finalizerCompletedOnce = false;
public bool isLastObject = false;
~BlockingFinalizerOnShutdown()