Skip to content

Commit b385842

Browse files
authored
Fix static fields counter (#26)
1 parent 416a22f commit b385842

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

source/MetadataProcessor.Core/nanoSkeletonGenerator.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ private void GenerateAssemblyHeader()
177177
// static fields
178178
int fieldCount = 0;
179179
var staticFields = c.Fields.Where(f => f.IsStatic && !f.HasConstant);
180-
staticFieldCount += staticFields.Count();
181180

182181
foreach (var f in staticFields)
183182
{
@@ -188,6 +187,9 @@ private void GenerateAssemblyHeader()
188187
});
189188
}
190189

190+
// update static field counter
191+
staticFieldCount += staticFields.Count();
192+
191193
int firstInstanceFieldId = GetInstanceFieldsOffset(c);
192194

193195
// 0 based index, need to add 1

0 commit comments

Comments
 (0)