diff options
author | jfrijters <jfrijters> | 2010-12-20 21:11:09 +0300 |
---|---|---|
committer | jfrijters <jfrijters> | 2010-12-20 21:11:09 +0300 |
commit | 4d4e2b91f75c1e8859689cfac2ff09e7b288b346 (patch) | |
tree | f1cef8ec79650f2294608967d9ee5e7b56fae312 /reflect/Metadata | |
parent | 6be0ac8b2615b26b8a804f603bfd2c76aa150203 (diff) |
Don't create duplicate ClassLayout table records when using the DefineType overload that specifies the size and also applying a StructLayoutAttribute.
Diffstat (limited to 'reflect/Metadata')
-rw-r--r-- | reflect/Metadata/Tables.cs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/reflect/Metadata/Tables.cs b/reflect/Metadata/Tables.cs index d734330a..c4a5b0b8 100644 --- a/reflect/Metadata/Tables.cs +++ b/reflect/Metadata/Tables.cs @@ -1241,6 +1241,19 @@ namespace IKVM.Reflection.Metadata internal int Parent; } + internal void AddOrReplaceRecord(Record rec) + { + for (int i = 0; i < records.Length; i++) + { + if (records[i].Parent == rec.Parent) + { + records[i] = rec; + return; + } + } + AddRecord(rec); + } + internal override void Read(MetadataReader mr) { for (int i = 0; i < records.Length; i++) |