Exit gracefully when running ildasm -nat against unsupported ni file. (#10821)
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)
commit20248521af31e2307fcd728f1ebbf7877bb5ee59
tree1560d82988840024f90aeb37e6a4c4ae44600b2f
parentec80b02b61839af453ce297faf4ce074edeee9da
Exit gracefully when running ildasm -nat against unsupported ni file. (#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 #10247
src/ildasm/dasm.cpp