Skip to content

Commit ce1ae87

Browse files
ivanpovazanivan
and
ivan
authored
Removing the assumption that StringHeap is always present in the metadata when computing table information (#665) (#666)
Co-authored-by: ivan <[email protected]>
1 parent f74703c commit ce1ae87

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)