>From ECMA-335
.pack directive, they would be naturally aligned; that is, placed on
addresses that are a multiple of 4. The
integer following .pack shall be one of the following: 0, 1, 2, 4, 8,
16, 32, 64, or 128. (A value of zero
indicates that the pack size used should match the default for the
current platform.)
-------------------------------------------
This means that if PackingSize = 0, there is no special packing info.
>From ECMA-335
The .size directive indicates a minimum size, and is intended to allow
for padding. Therefore, the amount of
memory allocated is the maximum of the size calculated from the layout
and the .size directive.
-------------------------------------------
Same as above.
>From Cecil\Mono.Cecil\TypeDefinition.cs
public ushort PackingSize {
get { return m_packingSize; }
set {
m_hasInfo = true;
m_packingSize = value;
}
}
public uint ClassSize {
get { return m_classSize; }
set {
m_hasInfo = true;
m_classSize = value;
}
These properties should be changed to
public ushort PackingSize {
get { return m_packingSize; }
set {
m_packingSize = value;
m_hasInfo = (m_packingSize > 0) || (m_classSize > 0);
}
}
public uint ClassSize {
get { return m_classSize; }
set {
m_classSize = value;
m_hasInfo = (m_packingSize > 0) || (m_classSize > 0);
}
ks
--~--~---------~--~----~------------~-------~--~----~
--
mono-cecil
-~----------~----~----~----~------~----~------~--~---