Skip to content

Commit

Permalink
Merge pull request #532 from ElektroKill/fix/pdb-writer-incorrect-col…
Browse files Browse the repository at this point in the history
…umn-sizes

Fix incorrect column sizes when writing portable or embedded PDB files
  • Loading branch information
wtfsck committed Nov 4, 2023
2 parents 67396c0 + 1e2c8f9 commit 8a012e9
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/DotNet/Writer/TablesHeap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,19 @@ public void CalculateLength() {
var dnTableSizes = new DotNetTableSizes();
var tableInfos = dnTableSizes.CreateTables(majorVersion, minorVersion);
var rowCounts = GetRowCounts();
dnTableSizes.InitializeSizes(bigStrings, bigGuid, bigBlob, systemTables ?? rowCounts, rowCounts, options.ForceBigColumns ?? false);

var debugSizes = rowCounts;
if (systemTables is not null) {
debugSizes = new uint[rowCounts.Length];
for (int i = 0; i < rowCounts.Length; i++) {
if (DotNetTableSizes.IsSystemTable((Table)i))
debugSizes[i] = systemTables[i];
else
debugSizes[i] = rowCounts[i];
}
}

dnTableSizes.InitializeSizes(bigStrings, bigGuid, bigBlob, rowCounts, debugSizes, options.ForceBigColumns ?? false);
for (int i = 0; i < Tables.Length; i++)
Tables[i].TableInfo = tableInfos[i];

Expand Down

0 comments on commit 8a012e9

Please # to comment.