From 57b93ba67c85fbe3c286609752d721b07dc46f76 Mon Sep 17 00:00:00 2001 From: Jan Vorlicek Date: Tue, 17 Sep 2019 09:55:20 +0200 Subject: [PATCH] Fix R2RDump to correctly parse array lower bounds (dotnet/coreclr#26743) There is a an incorrect size (likely a typo) used to create lower bounds array when parsing signatures. This results in `Index was outside the bounds of the array.` being printed inside of the array signature string. Commit migrated from https://github.com/dotnet/coreclr/commit/afd8b1f80a90a37d6b73987cbf9fdf03e8945250 --- src/coreclr/src/tools/r2rdump/R2RSignature.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/src/tools/r2rdump/R2RSignature.cs b/src/coreclr/src/tools/r2rdump/R2RSignature.cs index a70dca5..dc244a7 100644 --- a/src/coreclr/src/tools/r2rdump/R2RSignature.cs +++ b/src/coreclr/src/tools/r2rdump/R2RSignature.cs @@ -958,7 +958,7 @@ namespace R2RDump sizes[sizeIndex] = ReadUIntAndEmitInlineSignatureBinary(builder); } uint lowerBoundCount = ReadUIntAndEmitInlineSignatureBinary(builder); // number of lower bounds - int[] lowerBounds = new int[sizeCount]; + int[] lowerBounds = new int[lowerBoundCount]; for (uint lowerBoundIndex = 0; lowerBoundIndex < lowerBoundCount; lowerBoundIndex++) { lowerBounds[lowerBoundIndex] = ReadIntAndEmitInlineSignatureBinary(builder); -- 2.7.4