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:
authorFadi Hanna <fadim@microsoft.com>2017-08-10 04:30:24 +0300
committerFadi Hanna <fadim@microsoft.com>2017-08-10 04:30:24 +0300
commit5b23038ecf0a22f5a172f1eab164c80da4ea2cf8 (patch)
treebcd4c9d6961cd47a6319afddc844d16379d40e41 /src/System.Private.TypeLoader
parent6b846a325042c87385c09b9055066d0818bf65d2 (diff)
The value of the ValueTypePaddingField wasn't computed correctly. We were incorrectly using IntPtr.Size to compute the size of pointers. (Ex: running a x86 compiler to target x64, which is precisely what PX does).
Fixing the API to use the correct pointer size in both cases: runtime and compiler. Also, cleaning up code duplication. [tfs-changeset: 1669766]
Diffstat (limited to 'src/System.Private.TypeLoader')
-rw-r--r--src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/EETypeCreator.cs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/EETypeCreator.cs b/src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/EETypeCreator.cs
index 2caeb65bb..4ae1e6ad4 100644
--- a/src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/EETypeCreator.cs
+++ b/src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/EETypeCreator.cs
@@ -186,9 +186,10 @@ namespace Internal.Runtime.TypeLoader
if (pTemplateEEType != null)
{
- valueTypeFieldPaddingEncoded = EEType.ComputeValueTypeFieldPaddingFieldValue(
+ valueTypeFieldPaddingEncoded = EETypeBuilderHelpers.ComputeValueTypeFieldPaddingFieldValue(
pTemplateEEType->ValueTypeFieldPadding,
- (uint)pTemplateEEType->FieldAlignmentRequirement);
+ (uint)pTemplateEEType->FieldAlignmentRequirement,
+ IntPtr.Size);
baseSize = (int)pTemplateEEType->BaseSize;
isValueType = pTemplateEEType->IsValueType;
hasFinalizer = pTemplateEEType->IsFinalizable;
@@ -269,7 +270,7 @@ namespace Internal.Runtime.TypeLoader
// Add Object type pointer field to base size
baseSize += IntPtr.Size;
- valueTypeFieldPaddingEncoded = (uint)EEType.ComputeValueTypeFieldPaddingFieldValue(cbValueTypeFieldPadding, (uint)state.FieldAlignment.Value);
+ valueTypeFieldPaddingEncoded = (uint)EETypeBuilderHelpers.ComputeValueTypeFieldPaddingFieldValue(cbValueTypeFieldPadding, (uint)state.FieldAlignment.Value, IntPtr.Size);
}
// Minimum base size is 3 pointers, and requires us to bump the size of an empty class type