Removed incorrect optimization. If a FieldLayout record exists, we should always return the pseudo custom attribute FieldOffset, regardless of the declaring type's layout.

This commit is contained in:
jfrijters 2012-07-12 15:22:47 +00:00
Родитель 2f91e4253b
Коммит 8ae11694b7
1 изменённых файлов: 1 добавлений и 2 удалений

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

@ -130,8 +130,7 @@ namespace IKVM.Reflection.Reader
list.Add(spec.ToCustomAttribute(module));
}
}
if (declaringType.IsExplicitLayout
&& (attributeType == null || attributeType.IsAssignableFrom(module.universe.System_Runtime_InteropServices_FieldOffsetAttribute)))
if (attributeType == null || attributeType.IsAssignableFrom(module.universe.System_Runtime_InteropServices_FieldOffsetAttribute))
{
foreach (int i in module.FieldLayout.Filter(index + 1))
{