summaryrefslogtreecommitdiff
path: root/src/vm/methodtablebuilder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/vm/methodtablebuilder.cpp')
-rw-r--r--src/vm/methodtablebuilder.cpp58
1 files changed, 0 insertions, 58 deletions
diff --git a/src/vm/methodtablebuilder.cpp b/src/vm/methodtablebuilder.cpp
index c185ba112a..888dd7fb6f 100644
--- a/src/vm/methodtablebuilder.cpp
+++ b/src/vm/methodtablebuilder.cpp
@@ -21,7 +21,6 @@
#include "encee.h"
#include "mdaassistants.h"
#include "ecmakey.h"
-#include "security.h"
#include "customattribute.h"
#include "typestring.h"
@@ -4177,19 +4176,6 @@ VOID MethodTableBuilder::InitializeFieldDescs(FieldDesc *pFieldDescList,
pszFieldName
);
- // Check if the ValueType field containing non-publics is overlapped
- if (HasExplicitFieldOffsetLayout()
- && pLayoutFieldInfo != NULL
- && pLayoutFieldInfo->m_fIsOverlapped
- && pByValueClass != NULL
- && pByValueClass->GetClass()->HasNonPublicFields())
- {
- if (!Security::CanSkipVerification(GetAssembly()->GetDomainAssembly()))
- {
- BuildMethodTableThrowException(IDS_CLASSLOAD_BADOVERLAP);
- }
- }
-
// We're using FieldDesc::m_pMTOfEnclosingClass to temporarily store the field's size.
//
if (fIsByValue)
@@ -4290,14 +4276,6 @@ VOID MethodTableBuilder::InitializeFieldDescs(FieldDesc *pFieldDescList,
BAD_FORMAT_NOTHROW_ASSERT(!"ObjectRef in an RVA field");
BuildMethodTableThrowException(COR_E_BADIMAGEFORMAT, IDS_CLASSLOAD_BAD_FIELD, mdTokenNil);
}
- if (pByValueClass->GetClass()->HasNonPublicFields())
- {
- if (!Security::CanHaveRVA(GetAssembly()))
- {
- BAD_FORMAT_NOTHROW_ASSERT(!"ValueType with non-public fields as a type of an RVA field");
- BuildMethodTableThrowException(COR_E_BADIMAGEFORMAT, IDS_CLASSLOAD_BAD_FIELD, mdTokenNil);
- }
- }
}
}
@@ -4330,14 +4308,6 @@ VOID MethodTableBuilder::InitializeFieldDescs(FieldDesc *pFieldDescList,
{
fldSize = GetSizeForCorElementType(FieldDescElementType);
}
- if (!GetModule()->CheckRvaField(rva, fldSize))
- {
- if (!Security::CanHaveRVA(GetAssembly()))
- {
- BAD_FORMAT_NOTHROW_ASSERT(!"Illegal RVA of a mapped field");
- BuildMethodTableThrowException(COR_E_BADIMAGEFORMAT, IDS_CLASSLOAD_BAD_FIELD, mdTokenNil);
- }
- }
pFD->SetOffsetRVA(rva);
}
@@ -4377,14 +4347,6 @@ VOID MethodTableBuilder::InitializeFieldDescs(FieldDesc *pFieldDescList,
BAD_FORMAT_NOTHROW_ASSERT(!"ObjectRef in an RVA self-referencing static field");
BuildMethodTableThrowException(COR_E_BADIMAGEFORMAT, IDS_CLASSLOAD_BAD_FIELD, mdTokenNil);
}
- if (HasNonPublicFields())
- { // RVA ValueTypes with non-public fields must be checked against security
- if (!Security::CanHaveRVA(GetAssembly()))
- {
- BAD_FORMAT_NOTHROW_ASSERT(!"ValueType with non-public fields as a type of an RVA self-referencing static field");
- BuildMethodTableThrowException(COR_E_BADIMAGEFORMAT, IDS_CLASSLOAD_BAD_FIELD, mdTokenNil);
- }
- }
}
DWORD dwNumInstanceFields = dwCurrentDeclaredField + (HasParent() ? GetParentMethodTable()->GetNumInstanceFields() : 0);
@@ -4473,15 +4435,6 @@ MethodTableBuilder::VerifySelfReferencingStaticValueTypeFields_WithRVA(
{
DWORD rva;
IfFailThrow(GetMDImport()->GetFieldRVA(pFD->GetMemberDef(), &rva));
-
- if (!GetModule()->CheckRvaField(rva, bmtFP->NumInstanceFieldBytes))
- {
- if (!Security::CanHaveRVA(GetAssembly()))
- {
- BAD_FORMAT_NOTHROW_ASSERT(!"Illegal RVA of a mapped self-referencing static field");
- BuildMethodTableThrowException(COR_E_BADIMAGEFORMAT, IDS_CLASSLOAD_BAD_FIELD, mdTokenNil);
- }
- }
}
}
}
@@ -8536,17 +8489,6 @@ MethodTableBuilder::HandleExplicitLayout(
IDS_CLASSLOAD_EXPLICIT_LAYOUT);
}
- if (!explicitClassTrust.IsVerifiable())
- {
- if (!Security::CanSkipVerification(GetAssembly()->GetDomainAssembly()))
- {
- ThrowFieldLayoutError(GetCl(),
- GetModule(),
- firstObjectOverlapOffset,
- IDS_CLASSLOAD_UNVERIFIABLE_FIELD_LAYOUT);
- }
- }
-
if (!explicitClassTrust.IsNonOverLayed())
{
SetHasOverLayedFields();