Handle renamed compressed .mibc files gracefully in crossgen2/dotnet-pgo (#81955)
authorJakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
Sat, 11 Feb 2023 12:14:55 +0000 (13:14 +0100)
committerGitHub <noreply@github.com>
Sat, 11 Feb 2023 12:14:55 +0000 (13:14 +0100)
commit4af855b0101bad16a4e25a7ec3c4c6a2f2984fb0
tree2fa5d01586578b580512bcacc8aedbd0b6e14bca
parent4f0747d7431a94f84a4538c496290ccc77081dbc
Handle renamed compressed .mibc files gracefully in crossgen2/dotnet-pgo (#81955)

The existing logic would throw a NullReferenceException if you renamed a
compressed .mibc file and then tried to pass it to dotnet-pgo or
crossgen2. This PR adds a fallback case to look for a single .dll file
inside the archive when an entry with the expected name is not present.

In addition throw an exception with a better error message when the
lookup fails.
src/coreclr/tools/aot/ILCompiler.ReadyToRun/IBC/MIbcProfileParser.cs