Skip to content

Commit c9e57ba

Browse files
authored
Fix embedded source decoding on big-endian platforms in DiaSymReader (#386)
* big-endian fix * simplified the code
1 parent 2b62504 commit c9e57ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Microsoft.DiaSymReader/Extensions/SymUnmanagedExtensions.Document.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public static ArraySegment<byte> GetEmbeddedSource(this ISymUnmanagedDocument do
115115
throw new InvalidDataException();
116116
}
117117

118-
int uncompressedLength = BitConverter.ToInt32(blob, 0);
118+
int uncompressedLength = blob[0] + (blob[1] << 8) + (blob[2] << 16) + (blob[3] << 24);
119119
if (uncompressedLength == 0)
120120
{
121121
return new ArraySegment<byte>(blob, sizeof(int), bytesRead - sizeof(int));

0 commit comments

Comments
 (0)