Prevent invalid operations on MissingModule.

This commit is contained in:
jfrijters 2011-01-13 15:27:03 +00:00
Родитель 93baa6d3a4
Коммит 46b3f6c0ea
2 изменённых файлов: 41 добавлений и 1 удалений

Просмотреть файл

@ -296,6 +296,46 @@ namespace IKVM.Reflection
{ {
throw new MissingModuleException(this); throw new MissingModuleException(this);
} }
public override void __GetDataDirectoryEntry(int index, out int rva, out int length)
{
throw new MissingModuleException(this);
}
public override IList<CustomAttributeData> __GetPlaceholderAssemblyCustomAttributes(bool multiple, bool security)
{
throw new MissingModuleException(this);
}
public override long __RelativeVirtualAddressToFileOffset(int rva)
{
throw new MissingModuleException(this);
}
public override __StandAloneMethodSig __ResolveStandAloneMethodSig(int metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
{
throw new MissingModuleException(this);
}
public override int __Subsystem
{
get { throw new MissingModuleException(this); }
}
internal override void ExportTypes(int fileToken, IKVM.Reflection.Emit.ModuleBuilder manifestModule)
{
throw new MissingModuleException(this);
}
public override void GetPEKind(out PortableExecutableKinds peKind, out ImageFileMachine machine)
{
throw new MissingModuleException(this);
}
internal override IList<CustomAttributeData> GetCustomAttributesData(Type attributeType)
{
throw new MissingModuleException(this);
}
} }
sealed class MissingType : Type sealed class MissingType : Type

Просмотреть файл

@ -402,7 +402,7 @@ namespace IKVM.Reflection
internal abstract ByteReader GetBlob(int blobIndex); internal abstract ByteReader GetBlob(int blobIndex);
internal IList<CustomAttributeData> GetCustomAttributesData(Type attributeType) internal virtual IList<CustomAttributeData> GetCustomAttributesData(Type attributeType)
{ {
return GetCustomAttributes(0x00000001, attributeType); return GetCustomAttributes(0x00000001, attributeType);
} }