Exit gracefully when running ildasm -nat against unsupported ni file. (dotnet/coreclr...
authorJim Ma <mazong1123@gmail.com>
Sat, 8 Apr 2017 16:43:47 +0000 (00:43 +0800)
committerJan Kotas <jkotas@microsoft.com>
Sat, 8 Apr 2017 16:43:47 +0000 (09:43 -0700)
commit69df3b3c80b3a021f160d2788ad39200adac3a47
treec25d4fcff42ddff483c86c71be66c9cc8b430bb2
parent37fadc999c5c8022f0ce072e4d94a2bdcf8368a1
Exit gracefully when running ildasm -nat against unsupported ni file. (dotnet/coreclr#10821)

ildasm -nat only works for fragile native images (ie CoreLib only by default).
Running ildasm -nat against unsupported native images would cause a segmentation fault. This PR checks pNativeHeader->Signature == CORCOMPILE_SIGNATURE and end the program with a meaningful error message.

fix dotnet/coreclr#10247

Commit migrated from https://github.com/dotnet/coreclr/commit/20248521af31e2307fcd728f1ebbf7877bb5ee59
src/coreclr/src/ildasm/dasm.cpp