[llvm-readobj] flush output before crash

Otherwise the output could be lost.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372372 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Yuanfang Chen 2019-09-20 06:33:03 +00:00
parent a01099f226
commit bb41d69931

View File

@ -842,8 +842,10 @@ bool Decoder::dumpXDataRecord(const COFFObjectFile &COFF,
if ((int64_t)(Contents.size() - Offset - 4 * HeaderWords(XData) -
(XData.E() ? 0 : XData.EpilogueCount() * 4) -
(XData.X() ? 8 : 0)) < (int64_t)ByteCodeLength)
(XData.X() ? 8 : 0)) < (int64_t)ByteCodeLength) {
SW.flush();
report_fatal_error("Malformed unwind data");
}
if (XData.E()) {
ArrayRef<uint8_t> UC = XData.UnwindByteCode();