Skip to content

Commit

Permalink
Fix incorrect column sizes when writing portable or embedded PDB files
Browse files Browse the repository at this point in the history
  • Loading branch information
ElektroKill committed Nov 4, 2023
1 parent 67396c0 commit 1e2c8f9
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 1e2c8f9

Please sign in to comment.