Skip to content

Commit 6d7e4a5

Browse files
author
ivan
committed
Removing the assumption that StringHeap is always present in the metadata when computing table information (jbevain#665)
1 parent b2958c0 commit 6d7e4a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Mono.Cecil.PE/ImageReader.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ void ComputeTableInformations ()
481481
{
482482
uint offset = (uint) BaseStream.Position - table_heap_offset - image.MetadataSection.PointerToRawData; // header
483483

484-
int stridx_size = image.StringHeap.IndexSize;
484+
int stridx_size = image.StringHeap != null ? image.StringHeap.IndexSize : 2;
485485
int guididx_size = image.GuidHeap != null ? image.GuidHeap.IndexSize : 2;
486486
int blobidx_size = image.BlobHeap != null ? image.BlobHeap.IndexSize : 2;
487487

0 commit comments

Comments
 (0)