Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Strehovský <michals@microsoft.com>2015-11-25 00:42:04 +0300
committerMichal Strehovský <michals@microsoft.com>2015-11-25 00:42:04 +0300
commitc48f984a8f8ef3f64eb30c1373ec213aec150f00 (patch)
treef99d6877360c68455822481330f699efee608397 /src/Common
parent9752ed7527fc84cfee728cb34a4157234906aa4a (diff)
Make RVA static fields not participate in layout
These fields are not part of static field layout and the field layout algorithm shouldn't try to handle them. Issue #407 tracks handling of these.
Diffstat (limited to 'src/Common')
-rw-r--r--src/Common/src/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/Common/src/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs b/src/Common/src/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs
index 748b5eebc..57fea83e4 100644
--- a/src/Common/src/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs
+++ b/src/Common/src/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs
@@ -161,7 +161,7 @@ namespace Internal.TypeSystem
foreach (var field in type.GetFields())
{
- if (!field.IsStatic)
+ if (!field.IsStatic || field.HasRva)
continue;
numStaticFields++;
@@ -186,7 +186,8 @@ namespace Internal.TypeSystem
foreach (var field in type.GetFields())
{
- if (!field.IsStatic)
+ // Nonstatic fields and RVA mapped fields don't participate in layout
+ if (!field.IsStatic || field.HasRva)
continue;
StaticsBlock* block =
@@ -194,11 +195,6 @@ namespace Internal.TypeSystem
field.HasGCStaticBase ? &result.GcStatics :
&result.NonGcStatics;
- if (field.HasRva)
- {
- throw new NotImplementedException();
- }
-
SizeAndAlignment sizeAndAlignment = ComputeFieldSizeAndAlignment(field.FieldType, type.Context.Target.DefaultPackingSize);
block->Size = AlignmentHelper.AlignUp(block->Size, sizeAndAlignment.Alignment);